use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class ExtensionWithCustomStaticTypesTestCase method withOutputAttributesJsonType.
@Test
public void withOutputAttributesJsonType() throws Exception {
OperationModel o = getOperation("jsonAttributes");
assertJsonPerson(o.getOutputAttributes());
}
use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class ExtensionWithCustomStaticTypesTestCase method withOutputJsonType.
@Test
public void withOutputJsonType() throws Exception {
OperationModel o = getOperation("jsonOutput");
assertJsonPerson(o.getOutput());
}
use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class ExtensionWithCustomStaticTypesTestCase method withOutputXmlStaticType.
@Test
public void withOutputXmlStaticType() throws Exception {
OperationModel o = getOperation("xmlOutput");
assertXmlOrder(o.getOutput());
}
use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class ExtensionWithCustomStaticTypesTestCase method customTypeAttributes.
@Test
public void customTypeAttributes() throws Exception {
OperationModel o = getOperation("customAttributesOutput");
assertCustomJsonType(o.getOutputAttributes());
}
use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class XmlExtensionLoaderTestCase method testModuleGlobalElement.
@Test
public void testModuleGlobalElement() {
String modulePath = "modules/module-global-element.xml";
ExtensionModel extensionModel = getExtensionModelFrom(modulePath);
assertThat(extensionModel.getName(), is("module-global-element"));
assertThat(extensionModel.getConfigurationModels().size(), is(1));
ConfigurationModel configurationModel = extensionModel.getConfigurationModels().get(0);
assertThat(configurationModel.getName(), is(CONFIG_NAME));
assertThat(configurationModel.getAllParameterModels().size(), is(2));
assertThat(configurationModel.getAllParameterModels().get(0).getName(), is("username"));
Optional<GlobalElementComponentModelModelProperty> globalElementComponentModelModelProperty = configurationModel.getModelProperty(GlobalElementComponentModelModelProperty.class);
assertThat(globalElementComponentModelModelProperty.isPresent(), is(true));
assertThat(globalElementComponentModelModelProperty.get().getGlobalElements().size(), is(1));
assertThat(configurationModel.getOperationModels().size(), is(1));
Optional<OperationModel> operationModel = configurationModel.getOperationModel("do-something");
assertThat(operationModel.isPresent(), is(true));
assertThat(operationModel.get().getAllParameterModels().size(), is(3));
assertThat(operationModel.get().getAllParameterModels().get(0).getName(), is("somePetName"));
assertThat(operationModel.get().getAllParameterModels().get(1).getName(), is(TARGET_PARAMETER_NAME));
assertThat(operationModel.get().getAllParameterModels().get(2).getName(), is(TARGET_VALUE_PARAMETER_NAME));
Optional<OperationComponentModelModelProperty> modelProperty = operationModel.get().getModelProperty(OperationComponentModelModelProperty.class);
assertThat(modelProperty.isPresent(), is(true));
assertThat(modelProperty.get().getBodyComponentModel().getInnerComponents().size(), is(1));
}
Aggregations