use of org.mule.runtime.api.meta.model.stereotype.StereotypeModel 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.stereotype.StereotypeModel 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.stereotype.StereotypeModel 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.stereotype.StereotypeModel 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);
}
use of org.mule.runtime.api.meta.model.stereotype.StereotypeModel in project mule by mulesoft.
the class DefaultExtensionModelFactoryTestCase method customStereotype.
@Test
public void customStereotype() {
ExtensionModel extensionModel = createExtension(HeisenbergExtension.class);
OperationModel operation = extensionModel.getConfigurationModels().get(0).getOperationModel("callSaul").get();
StereotypeModel stereotypeModel = operation.getStereotype();
assertThat(stereotypeModel.isAssignableTo(PROCESSOR), is(true));
assertThat(stereotypeModel.getType(), is(new EmpireStereotype().getName().toUpperCase()));
assertThat(stereotypeModel.getNamespace(), is(HEISENBERG.toUpperCase()));
assertThat(stereotypeModel.getParent().get(), is(PROCESSOR));
}
Aggregations