use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class ExportedArtifactsCollectorTestCase method setup.
@Before
public void setup() {
ClassLoaderModelProperty classLoaderModelProperty = new ClassLoaderModelProperty(getClass().getClassLoader());
when(extensionModel.getModelProperty(ClassLoaderModelProperty.class)).thenReturn(of(classLoaderModelProperty));
OutputModel appleList = mockOutputModel(new TypeToken<List<Apple>>() {
}.getType());
OperationModel firstOperation = mockOperationModel(appleList, mockOutputModel(List.class));
withMethod(firstOperation, getApiMethods(HeisenbergOperations.class).stream().filter(m -> m.getName().equals("callGusFring")).findFirst());
ParameterModel parameter = mockParameterModel(Shape.class);
OutputModel resultList = mockOutputModel(new TypeToken<List<Result<Apple, VeganAttributes>>>() {
}.getType());
OperationModel secondOperation = mockOperationModel(resultList, mockOutputModel(List.class), parameter);
withMethod(secondOperation, empty());
when(extensionModel.getOperationModels()).thenReturn(asList(firstOperation, secondOperation));
visitableMock(firstOperation, secondOperation);
collector = new ExportedArtifactsCollector(extensionModel);
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class StereotypesDeclarationEnricherTestCase method operationParameterWithFlowReferenceParameter.
@Test
public void operationParameterWithFlowReferenceParameter() {
OperationModel operation = configuration.getOperationModel("withFlowReference").get();
assertThat(operation.getAllParameterModels(), hasSize(1));
ParameterModel param = operation.getAllParameterModels().get(0);
List<StereotypeModel> stereotypes = param.getAllowedStereotypes();
assertThat(stereotypes, hasSize(1));
assertThat(stereotypes.get(0), is(FLOW));
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class StereotypesDeclarationEnricherTestCase method connectionProviderWithMultipleConfigReferenceParameter.
@Test
public void connectionProviderWithMultipleConfigReferenceParameter() {
ParameterModel paramWithReferences = configuration.getConnectionProviders().get(0).getAllParameterModels().get(0);
List<StereotypeModel> allowedStereotypes = paramWithReferences.getAllowedStereotypes();
assertThat(allowedStereotypes, hasSize(2));
assertStereotype(allowedStereotypes.get(0), HeisenbergExtension.HEISENBERG, "config", CONFIG);
assertStereotype(allowedStereotypes.get(1), MARVEL_EXTENSION, CONFIG_NAME, CONFIG);
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class StereotypesDeclarationEnricherTestCase method configWithObjectStoreReference.
@Test
public void configWithObjectStoreReference() {
ParameterModel osParam = configuration.getAllParameterModels().stream().filter(p -> p.getName().equals("spellStore")).findFirst().get();
assertThat(osParam.getAllowedStereotypes(), hasSize(1));
StereotypeModel stereotypeModel = osParam.getAllowedStereotypes().get(0);
assertThat(stereotypeModel, is(OBJECT_STORE));
}
use of org.mule.runtime.api.meta.model.parameter.ParameterModel in project mule by mulesoft.
the class StereotypesDeclarationEnricherTestCase method configurationWithConfigReferenceParameter.
@Test
public void configurationWithConfigReferenceParameter() {
List<ParameterModel> params = configuration.getAllParameterModels();
assertThat(params, hasSize(3));
ParameterModel param = params.get(0);
List<StereotypeModel> allowedStereotypes = param.getAllowedStereotypes();
assertThat(allowedStereotypes, hasSize(1));
assertStereotype(allowedStereotypes.get(0), MARVEL_EXTENSION, CONFIG_NAME, CONFIG);
}
Aggregations