Search in sources :

Example 11 with ProblemsReporter

use of org.mule.runtime.extension.api.loader.ProblemsReporter in project mule by mulesoft.

the class TransactionalParametersValidatorTestCase method setUp.

@Before
public void setUp() {
    when(extensionModel.getSourceModels()).thenReturn(singletonList(sourceModel));
    when(extensionModel.getOperationModels()).thenReturn(singletonList(operationModel));
    when(sourceModel.getErrorCallback()).thenReturn(Optional.empty());
    when(sourceModel.getSuccessCallback()).thenReturn(Optional.empty());
    when(sourceModel.getParameterGroupModels()).thenReturn(singletonList(parameterGroupModel));
    when(sourceModel.isTransactional()).thenReturn(true);
    when(operationModel.isTransactional()).thenReturn(true);
    when(parameterGroupModel.getParameterModels()).thenReturn(singletonList(txParameter));
    when(txParameter.getName()).thenReturn(TRANSACTIONAL_ACTION_PARAMETER_NAME);
    when(txParameter.getModelProperty(TransactionalActionModelProperty.class)).thenReturn(transactionalActionModelProperty);
    problemsReporter = new ProblemsReporter(extensionModel);
}
Also used : ProblemsReporter(org.mule.runtime.extension.api.loader.ProblemsReporter) Before(org.junit.Before)

Example 12 with ProblemsReporter

use of org.mule.runtime.extension.api.loader.ProblemsReporter in project mule by mulesoft.

the class ValueProviderModelValidatorTestCase method setUp.

@Before
public void setUp() {
    valueProviderModelValidator = new ValueProviderModelValidator();
    problemsReporter = new ProblemsReporter(extensionModel);
    operationParameterBuilder = ValueProviderFactoryModelProperty.builder(SomeValueProvider.class);
    configrationParameterBuilder = ValueProviderFactoryModelProperty.builder(SomeValueProvider.class);
    visitableMock(operationModel);
    when(extensionModel.getConfigurationModels()).thenReturn(asList(configurationModel));
    when(configurationModel.getAllParameterModels()).thenReturn(asList(configrationParameter));
    when(configurationModel.getParameterGroupModels()).thenReturn(asList(configurationParameterGroupModel));
    when(configurationModel.getName()).thenReturn("SomeConfig");
    when(configurationParameterGroupModel.getParameterModels()).thenReturn(asList(configrationParameter));
    when(extensionModel.getOperationModels()).thenReturn(singletonList(operationModel));
    when(operationModel.getAllParameterModels()).thenReturn(asList(operationParameter));
    when(operationModel.getName()).thenReturn("superOperation");
    when(parameterGroupModel.getParameterModels()).thenReturn(asList(operationParameter));
    when(operationModel.getParameterGroupModels()).thenReturn(asList(parameterGroupModel));
    mockParameter(configrationParameter, configrationParameterBuilder);
    mockParameter(operationParameter, operationParameterBuilder);
}
Also used : ProblemsReporter(org.mule.runtime.extension.api.loader.ProblemsReporter) Before(org.junit.Before)

Aggregations

ProblemsReporter (org.mule.runtime.extension.api.loader.ProblemsReporter)12 Problem (org.mule.runtime.extension.api.loader.Problem)7 String.format (java.lang.String.format)6 ExtensionModel (org.mule.runtime.api.meta.model.ExtensionModel)6 ExtensionModelValidator (org.mule.runtime.extension.api.loader.ExtensionModelValidator)6 MetadataType (org.mule.metadata.api.model.MetadataType)5 ObjectType (org.mule.metadata.api.model.ObjectType)5 MetadataTypeVisitor (org.mule.metadata.api.visitor.MetadataTypeVisitor)5 OperationModel (org.mule.runtime.api.meta.model.operation.OperationModel)5 SourceModel (org.mule.runtime.api.meta.model.source.SourceModel)5 Optional (java.util.Optional)4 Set (java.util.Set)4 ArrayType (org.mule.metadata.api.model.ArrayType)4 JAVA (org.mule.metadata.api.model.MetadataFormat.JAVA)4 NamedObject (org.mule.runtime.api.meta.NamedObject)4 ParameterModel (org.mule.runtime.api.meta.model.parameter.ParameterModel)4 ExtensionMetadataTypeUtils.getType (org.mule.runtime.extension.api.util.ExtensionMetadataTypeUtils.getType)4 HashSet (java.util.HashSet)3 Collectors.joining (java.util.stream.Collectors.joining)3 Collectors.toSet (java.util.stream.Collectors.toSet)3