use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration in project mule by mulesoft.
the class OperationDescriptionDocumenter method documentOperations.
private void documentOperations(WithOperationsDeclaration<?> declaration, Map<String, Element> methods) {
for (OperationDeclaration operation : declaration.getOperations()) {
Element method = methods.get(operation.getName());
// the one which defined the operation being processed
if (method == null) {
continue;
}
MethodDocumentation documentation = processor.getMethodDocumentation(processingEnv, method);
operation.setDescription(documentation.getSummary());
parameterDeclarer.document(operation, method, documentation);
}
}
use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration in project mule by mulesoft.
the class GroupLayoutTestCase method groupLayout.
@Test
public void groupLayout() {
OperationDeclaration operation = getOperation(extensionDeclaration, "convinceAnimalKiller");
assertThat(operation.getParameterGroups(), hasSize(2));
ParameterGroupDeclaration group = operation.getParameterGroups().get(0);
assertThat(group.getLayoutModel().getTabName().get(), is(ARGUMENTS_TAB));
}
use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration in project mule by mulesoft.
the class JavaDeclarationDelegateTestCase method assertOperation.
private void assertOperation(WithOperationsDeclaration declaration, String operationName, String operationDescription) throws Exception {
OperationDeclaration operation = getOperation(declaration, operationName);
assertThat(operation, is(notNullValue()));
assertThat(operation.getDescription(), equalTo(operationDescription));
}
use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration in project mule by mulesoft.
the class JavaDeclarationDelegateTestCase method flowListeningOperationWithoutAttributes.
@Test
public void flowListeningOperationWithoutAttributes() {
setLoader(loaderFor(VeganExtension.class));
ExtensionDeclarer declarer = declareExtension();
final ExtensionDeclaration declaration = declarer.getDeclaration();
OperationDeclaration operation = getOperation(getConfiguration(declaration, BANANA), "getLunch");
assertThat(operation, is(notNullValue()));
assertOutputType(operation.getOutput(), toMetadataType(Fruit.class), false);
assertOutputType(operation.getOutputAttributes(), TYPE_BUILDER.voidType().build(), false);
}
use of org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration in project mule by mulesoft.
the class JavaDeclarationDelegateTestCase method listOfResultsOperationWithoutGenerics.
@Test
public void listOfResultsOperationWithoutGenerics() throws Exception {
ExtensionDeclarer declarer = loaderFor(HeisenbergWithListOfResultOperations.class).declare(new DefaultExtensionLoadingContext(getClass().getClassLoader(), getDefault(emptySet())));
OperationDeclaration operation = getOperation(declarer.getDeclaration(), "listOfResultsWithoutGenerics");
MetadataType outputType = operation.getOutput().getType();
assertThat(outputType, is(instanceOf(ArrayType.class)));
assertMessageType(((ArrayType) outputType).getType(), TYPE_BUILDER.anyType().build(), TYPE_BUILDER.anyType().build());
}
Aggregations