summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-11-26 10:29:09 +0000
committerMichael Morris <michael.morris@est.tech>2023-02-09 11:39:31 +0000
commitbe850f6e83cbaa5c16f79c2c8732583f42e55429 (patch)
tree3b36e783c5018ffe79e309397a88ca70721ede6e /catalog-be/src/test/java
parente2a9c9c4d6c76bf4c70953a9e5289777bc63c1f5 (diff)
Consider model in generic substitution type query
Change-Id: I9905b5f6b1bd658befb88b2dbb6903dfaa1f0f8a Issue-ID: SDC-3794 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-be/src/test/java')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/generic/GenericTypeBusinessLogicTest.java7
1 files changed, 5 insertions, 2 deletions
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<Resource, ResponseFormat> 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<Resource, ResponseFormat> fetchedGenericType = testInstance.fetchDerivedFromGenericType(resource);
assertEquals(genericResource, fetchedGenericType.left().value());
}