use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration in project mule by mulesoft.
the class TargetParameterDeclarationEnricherTestCase method verifyTargetValueParameterOnOperation.
@Test
public void verifyTargetValueParameterOnOperation() {
OperationDeclaration operationDeclaration = getNamedObject(declaration.getOperations(), "transform");
ParameterDeclaration parameterDeclaration = getNamedObject(operationDeclaration.getAllParameters(), "targetValue");
assertThat(parameterDeclaration.getName(), is("targetValue"));
assertThat(parameterDeclaration.getExpressionSupport(), is(REQUIRED));
assertThat(parameterDeclaration.getType(), instanceOf(StringType.class));
assertThat(parameterDeclaration.isRequired(), is(false));
}
use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration in project mule by mulesoft.
the class TargetParameterDeclarationEnricherTestCase method verifyTargetParameterOnOperation.
@Test
public void verifyTargetParameterOnOperation() {
OperationDeclaration operationDeclaration = getNamedObject(declaration.getOperations(), "transform");
ParameterDeclaration parameterDeclaration = getNamedObject(operationDeclaration.getAllParameters(), "target");
assertThat(parameterDeclaration.getName(), is("target"));
assertThat(parameterDeclaration.getExpressionSupport(), is(NOT_SUPPORTED));
assertThat(parameterDeclaration.getType(), instanceOf(StringType.class));
assertThat(parameterDeclaration.isRequired(), is(false));
}
use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration in project mule by mulesoft.
the class ComplexExtensionLoadingTestCase method assertOperation.
private void assertOperation(String configName, String operationName) {
ConfigurationDeclaration config = extensionDeclaration.getConfigurations().stream().filter(c -> c.getName().equals(configName)).findFirst().orElseThrow(() -> new IllegalArgumentException("No config with name " + configName));
OperationDeclaration operation = config.getOperations().stream().filter(model -> model.getName().equals(operationName)).findFirst().orElseThrow(() -> new IllegalArgumentException("No operation with name " + operationName));
assertThat(operation.getName(), is(operationName));
}
use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration in project mule by mulesoft.
the class ExclusiveOptionalModelTestCase method exclusiveOptionals.
@Test
public void exclusiveOptionals() {
OperationDeclaration operation = getOperation(extensionDeclaration, "convinceAnimalKiller");
assertThat(operation.getParameterGroups(), hasSize(2));
ParameterGroupDeclaration group = operation.getParameterGroups().get(0);
assertThat(group.getName(), equalTo("arguments"));
assertThat(group.getExclusiveParameters(), hasSize(1));
ExclusiveParametersDeclaration exclusive = group.getExclusiveParameters().get(0);
assertThat(exclusive.isRequiresOne(), is(false));
assertThat(exclusive.getParameterNames(), containsInAnyOrder("argument1", "argument2", "argument3"));
}
use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration 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);
}
Aggregations