From e2a9c9c4d6c76bf4c70953a9e5289777bc63c1f5 Mon Sep 17 00:00:00 2001 From: vasraz Date: Mon, 30 Jan 2023 15:17:39 +0000 Subject: Improve getting Service with specific version Signed-off-by: Vasyl Razinkov Change-Id: Ia788649016fe261802a081788b8844a80bbc3dcc Issue-ID: SDC-4358 --- .../jsonjanusgraph/operations/ToscaOperationFacadeTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'catalog-model/src/test/java/org') diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacadeTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacadeTest.java index 8aa4353266..f32c5e2842 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacadeTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacadeTest.java @@ -649,9 +649,10 @@ class ToscaOperationFacadeTest { } @Test - void testGetBySystemName() { - Either, StorageOperationStatus> result; + void testGetBySystemNameAndVersion() { + Either result; String sysName = "sysName"; + String version = "version"; ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE; ToscaElement toscaElement = getToscaElementForTest(); List componentVertices = new ArrayList<>(); @@ -662,6 +663,7 @@ class ToscaOperationFacadeTest { propertiesToMatch.put(GraphPropertyEnum.SYSTEM_NAME, sysName); propertiesToMatch.put(GraphPropertyEnum.COMPONENT_TYPE, componentTypeEnum.name()); + propertiesToMatch.put(GraphPropertyEnum.VERSION, version); propertiesNotToMatch.put(GraphPropertyEnum.IS_DELETED, true); @@ -669,9 +671,9 @@ class ToscaOperationFacadeTest { .thenReturn(Either.left(componentVertices)); when(topologyTemplateOperationMock.getToscaElement(any(GraphVertex.class), any(ComponentParametersView.class))) .thenReturn(Either.left(toscaElement)); - result = testInstance.getBySystemName(componentTypeEnum, sysName); + result = testInstance.getBySystemNameAndVersion(componentTypeEnum, sysName, version); assertTrue(result.isLeft()); - assertEquals(1, result.left().value().size()); + assertNotNull(result.left().value()); } @Test -- cgit 1.2.3-korg