use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration in project mule by mulesoft.
the class DisplayDeclarationEnricherTestCase method parsePathParameterThatIsDirectory.
@Test
public void parsePathParameterThatIsDirectory() {
ExtensionDeclaration declaration = marvelDeclarer.getDeclaration();
ConfigurationDeclaration config = findConfigByName(declaration, IronMan.CONFIG_NAME);
ConnectionProviderDeclaration missileProvider = findProviderByName(config, MissileProvider.NAME);
List<ParameterDeclaration> params = missileProvider.getAllParameters();
assertThat(params, hasSize(1));
ParameterDeclaration pathParam = params.get(0);
Optional<PathModel> pathModel = pathParam.getDisplayModel().getPathModel();
assertThat(pathModel.isPresent(), is(true));
assertThat(pathModel.get().getType(), is(DIRECTORY));
assertThat(pathModel.get().acceptsUrls(), is(false));
assertThat(pathModel.get().getFileExtensions(), empty());
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration in project mule by mulesoft.
the class JavaDeclarationDelegateTestCase method heisenbergPointerPlusExternalConfig.
@Test
public void heisenbergPointerPlusExternalConfig() {
setLoader(loaderFor(HeisenbergPointerPlusExternalConfig.class));
ExtensionDeclaration extensionDeclaration = declareExtension().getDeclaration();
assertExtensionProperties(extensionDeclaration, OTHER_HEISENBERG);
assertThat(extensionDeclaration.getConfigurations().size(), equalTo(2));
ConfigurationDeclaration configuration = extensionDeclaration.getConfigurations().get(1);
assertThat(configuration, is(notNullValue()));
assertThat(configuration.getName(), equalTo(EXTENDED_CONFIG_NAME));
assertThat(configuration.getAllParameters(), hasSize(32));
assertParameter(configuration.getAllParameters(), "extendedProperty", "", STRING_TYPE, true, SUPPORTED, null);
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration in project mule by mulesoft.
the class LayoutModelTestCase method parseLayoutAnnotationsOnParameter.
@Test
public void parseLayoutAnnotationsOnParameter() {
ExtensionDeclarer declarer = declareExtension();
ExtensionDeclaration extensionDeclaration = declarer.getDeclaration();
final ConfigurationDeclaration configurationDeclaration = extensionDeclaration.getConfigurations().get(0);
assertParameterPlacement(findParameterInGroup(configurationDeclaration, "labeledRicin"), RICIN_GROUP_NAME, 1);
assertParameterPlacement(findParameterInGroup(configurationDeclaration, "ricinPacks"), RICIN_GROUP_NAME, 2);
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration in project mule by mulesoft.
the class LayoutModelTestCase method parseLayoutAnnotationsOnOperationParameter.
@Test
public void parseLayoutAnnotationsOnOperationParameter() {
ExtensionDeclarer declarer = declareExtension();
ExtensionDeclaration extensionDeclaration = declarer.getDeclaration();
OperationDeclaration operation = getOperation(extensionDeclaration, KILL_CUSTOM_OPERATION);
assertThat(operation, is(notNullValue()));
assertParameterPlacement(findParameterInGroup(operation, "victim"), KILL_WITH_GROUP, 1);
assertParameterPlacement(findParameterInGroup(operation, "goodbyeMessage"), KILL_WITH_GROUP, 2);
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration in project mule by mulesoft.
the class LayoutModelTestCase method parseLayoutAnnotationsOnParameterGroup.
@Test
public void parseLayoutAnnotationsOnParameterGroup() {
ExtensionDeclarer declarer = declareExtension();
ExtensionDeclaration extensionDeclaration = declarer.getDeclaration();
ConfigurationDeclaration config = extensionDeclaration.getConfigurations().get(0);
assertParameterPlacement(findParameterInGroup(config, "myName"), PERSONAL_INFORMATION_GROUP_NAME, 1);
assertParameterPlacement(findParameterInGroup(config, "age"), PERSONAL_INFORMATION_GROUP_NAME, 2);
assertParameterPlacement(findParameterInGroup(config, "dateOfConception"), PERSONAL_INFORMATION_GROUP_NAME, 3);
assertParameterPlacement(findParameterInGroup(config, "dateOfBirth"), PERSONAL_INFORMATION_GROUP_NAME, 4);
assertParameterPlacement(findParameterInGroup(config, "dateOfDeath"), PERSONAL_INFORMATION_GROUP_NAME, 5);
}
Aggregations