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;
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)
);
componentInstanceProperty.setSchema(schemaDefinition);
}
if (toscaGetFunction != null) {
- componentInstanceProperty.setToscaGetFunction(toscaGetFunction);
+ componentInstanceProperty.setToscaFunction(toscaGetFunction);
}
return componentInstanceProperty;
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());
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());
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();
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);