diff options
author | vasraz <vasyl.razinkov@est.tech> | 2023-01-30 15:17:39 +0000 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-02-09 11:19:05 +0000 |
commit | e2a9c9c4d6c76bf4c70953a9e5289777bc63c1f5 (patch) | |
tree | 070f87478380f7637291c23c51f20319b6587ea5 /catalog-model/src/test/java | |
parent | c6cb16f234b8ae9de4aede3ca09a57e6ca177abe (diff) |
Improve getting Service with specific version
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: Ia788649016fe261802a081788b8844a80bbc3dcc
Issue-ID: SDC-4358
Diffstat (limited to 'catalog-model/src/test/java')
-rw-r--r-- | catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaOperationFacadeTest.java | 10 |
1 files changed, 6 insertions, 4 deletions
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<List<Component>, StorageOperationStatus> result; + void testGetBySystemNameAndVersion() { + Either<Component, StorageOperationStatus> result; String sysName = "sysName"; + String version = "version"; ComponentTypeEnum componentTypeEnum = ComponentTypeEnum.RESOURCE; ToscaElement toscaElement = getToscaElementForTest(); List<GraphVertex> 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 |