From be850f6e83cbaa5c16f79c2c8732583f42e55429 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Fri, 26 Nov 2021 10:29:09 +0000 Subject: Consider model in generic substitution type query Change-Id: I9905b5f6b1bd658befb88b2dbb6903dfaa1f0f8a Issue-ID: SDC-3794 Signed-off-by: andre.schmid --- .../be/components/impl/generic/GenericTypeBusinessLogicTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'catalog-be/src/test/java/org/openecomp') diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java index 564e02dca5..ff0bd72113 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java @@ -86,8 +86,9 @@ class GenericTypeBusinessLogicTest { cvfc.setResourceType(ResourceTypeEnum.CVFC); cvfc.setDerivedFrom(Arrays.asList("genericType", "someOtherType")); cvfc.setDerivedFromGenericType("genericType"); + cvfc.setModel("model"); Resource genericResource = new Resource(); - when(toscaOperationFacadeMock.getLatestCertifiedNodeTypeByToscaResourceName(cvfc.getDerivedFromGenericType())) + when(toscaOperationFacadeMock.getLatestByToscaResourceNameAndModel(cvfc.getDerivedFromGenericType(), cvfc.getModel())) .thenReturn(Either.left(genericResource)); Either fetchedGenericType = testInstance.fetchDerivedFromGenericType(cvfc); assertEquals(genericResource, fetchedGenericType.left().value()); @@ -99,8 +100,10 @@ class GenericTypeBusinessLogicTest { when(resource.getResourceType()).thenReturn(ResourceTypeEnum.VF); final var genericType = "genericType"; when(resource.fetchGenericTypeToscaNameFromConfig()).thenReturn(genericType); + final var model = "model"; + when(resource.getModel()).thenReturn(model); Resource genericResource = new Resource(); - when(toscaOperationFacadeMock.getLatestCertifiedNodeTypeByToscaResourceName(genericType)).thenReturn(Either.left(genericResource)); + when(toscaOperationFacadeMock.getLatestByToscaResourceNameAndModel(genericType, model)).thenReturn(Either.left(genericResource)); Either fetchedGenericType = testInstance.fetchDerivedFromGenericType(resource); assertEquals(genericResource, fetchedGenericType.left().value()); } -- cgit 1.2.3-korg