From 68733163804ed2efed8223a04ab0a7a0714a8b33 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Thu, 7 Jul 2022 17:17:52 +0100 Subject: Support for concat TOSCA function Adds support for the concat TOSCA function in an instance property. Refactors the TOSCA function structure so it can be more generic to support other functions in the future. Change-Id: I338e4138d26afe21779da57c4eeb3f2d486c20a9 Issue-ID: SDC-4095 Signed-off-by: andre.schmid --- .../impl/ComponentInstanceBusinessLogicTest.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'catalog-be/src/test/java/org/openecomp') diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java index cd916d0d1e..96c6762d74 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java @@ -73,6 +73,7 @@ import org.mockito.MockitoAnnotations; import org.openecomp.sdc.be.components.impl.exceptions.ByActionStatusComponentException; import org.openecomp.sdc.be.components.impl.exceptions.ByResponseFormatComponentException; import org.openecomp.sdc.be.components.impl.exceptions.ComponentException; +import org.openecomp.sdc.be.components.impl.exceptions.ToscaFunctionExceptionSupplier; import org.openecomp.sdc.be.components.impl.exceptions.ToscaGetFunctionExceptionSupplier; import org.openecomp.sdc.be.components.validation.UserValidations; import org.openecomp.sdc.be.config.ConfigurationManager; @@ -385,7 +386,7 @@ class ComponentInstanceBusinessLogicTest { propertyGetInput.setType("list"); final SchemaDefinition listStringPropertySchema = createSchema(schemaType); propertyGetInput.setSchema(listStringPropertySchema); - propertyGetInput.setToscaGetFunction( + propertyGetInput.setToscaFunction( createGetToscaFunction(inputName, inputId, List.of(propertyGetInput.getName()), PropertySource.SELF, ToscaGetFunctionType.GET_INPUT, containerComponentId, containerComponentName) ); @@ -552,7 +553,7 @@ class ComponentInstanceBusinessLogicTest { componentInstanceProperty.setSchema(schemaDefinition); } if (toscaGetFunction != null) { - componentInstanceProperty.setToscaGetFunction(toscaGetFunction); + componentInstanceProperty.setToscaFunction(toscaGetFunction); } return componentInstanceProperty; @@ -612,7 +613,7 @@ class ComponentInstanceBusinessLogicTest { final ResponseFormat actualResponse = responseFormatEither.right().value(); final ResponseFormat expectedResponse = ToscaGetFunctionExceptionSupplier - .propertySchemaDiverge(propertyGetInput.getToscaGetFunction().getFunctionType(), inputDefinition.getSchemaType(), + .propertySchemaDiverge(propertyGetInput.getToscaFunction().getType(), inputDefinition.getSchemaType(), propertyGetInput.getSchemaType()) .get().getResponseFormat(); assertEquals(expectedResponse.getFormattedMessage(), actualResponse.getFormattedMessage()); @@ -672,7 +673,7 @@ class ComponentInstanceBusinessLogicTest { final ResponseFormat actualResponse = responseFormatEither.right().value(); final ResponseFormat expectedResponse = ToscaGetFunctionExceptionSupplier - .propertyTypeDiverge(propertyGetInput.getToscaGetFunction().getFunctionType(), inputDefinition.getType(), propertyGetInput.getType()) + .propertyTypeDiverge(propertyGetInput.getToscaFunction().getType(), inputDefinition.getType(), propertyGetInput.getType()) .get().getResponseFormat(); assertEquals(expectedResponse.getFormattedMessage(), actualResponse.getFormattedMessage()); assertEquals(expectedResponse.getStatus(), actualResponse.getStatus()); @@ -689,7 +690,7 @@ class ComponentInstanceBusinessLogicTest { final List properties = new ArrayList<>(); final ComponentInstanceProperty propertyGetInput = new ComponentInstanceProperty(); propertyGetInput.setName("anyName"); - propertyGetInput.setToscaGetFunction(toscaGetFunction); + propertyGetInput.setToscaFunction(toscaGetFunction); properties.add(propertyGetInput); final Component component = new Service(); @@ -2659,8 +2660,8 @@ class ComponentInstanceBusinessLogicTest { private static Stream getToscaFunctionForValidation() { final var toscaGetFunction1 = new ToscaGetFunctionDataDefinition(); - final ResponseFormat expectedResponse1 = ToscaGetFunctionExceptionSupplier - .targetFunctionTypeNotFound().get().getResponseFormat(); + final ResponseFormat expectedResponse1 = ToscaFunctionExceptionSupplier + .missingFunctionType().get().getResponseFormat(); final var toscaGetFunction2 = new ToscaGetFunctionDataDefinition(); toscaGetFunction2.setFunctionType(ToscaGetFunctionType.GET_INPUT); -- cgit 1.2.3-korg