diff options
author | andre.schmid <andre.schmid@est.tech> | 2022-07-07 17:17:52 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-07-18 14:22:12 +0000 |
commit | 68733163804ed2efed8223a04ab0a7a0714a8b33 (patch) | |
tree | 013f4d25042aa776120971a612a52d64db52f7a7 /catalog-be/src/test/java/org | |
parent | 4e4ec8e9c21acf7f9210aaebf8f13a60542737fc (diff) |
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 <andre.schmid@est.tech>
Diffstat (limited to 'catalog-be/src/test/java/org')
-rw-r--r-- | catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogicTest.java | 15 |
1 files changed, 8 insertions, 7 deletions
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<ComponentInstanceProperty> 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<Arguments> 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); |