use of org.mule.runtime.api.meta.model.declaration.fluent.ParameterDeclaration in project mule by mulesoft.
the class DisplayDeclarationEnricherTestCase method parseDisplayAnnotationsOnParameter.
@Test
public void parseDisplayAnnotationsOnParameter() {
ExtensionDeclaration extensionDeclaration = heisenbergDeclarer.getDeclaration();
List<ParameterDeclaration> parameters = extensionDeclaration.getConfigurations().get(0).getAllParameters();
assertParameterDisplayName(findParameter(parameters, PARAMETER_ORIGINAL_OVERRIDED_DISPLAY_NAME), PARAMETER_OVERRIDED_DISPLAY_NAME);
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ParameterDeclaration in project mule by mulesoft.
the class DisplayDeclarationEnricherTestCase method parseSummaryAnnotationOnOperationParameter.
@Test
public void parseSummaryAnnotationOnOperationParameter() {
ExtensionDeclaration extensionDeclaration = heisenbergDeclarer.getDeclaration();
OperationDeclaration operation = getOperation(extensionDeclaration, HeisenbergOperations.OPERATION_WITH_SUMMARY);
assertThat(operation, is(notNullValue()));
List<ParameterDeclaration> parameters = operation.getAllParameters();
assertParameterSummary(findParameter(parameters, DOOR_PARAMETER), KNOCKEABLE_DOORS_SUMMARY);
}
use of org.mule.runtime.api.meta.model.declaration.fluent.ParameterDeclaration in project mule by mulesoft.
the class DynamicMetadataDeclarationEnricherTestCase method declareStaticAndDynamicTypesInSource.
@Test
public void declareStaticAndDynamicTypesInSource() {
List<SourceDeclaration> messageSources = declaration.getConfigurations().get(0).getMessageSources();
SourceDeclaration sourceDynamicAttributes = getDeclaration(messageSources, "MetadataSource");
assertOutputType(sourceDynamicAttributes.getOutput(), TYPE_BUILDER.objectType().with(new ClassInformationAnnotation(Map.class, asList(String.class, Object.class))).openWith(TYPE_LOADER.load(Object.class)).build(), true);
assertOutputType(sourceDynamicAttributes.getOutputAttributes(), toMetadataType(StringAttributes.class), false);
assertParameterType(getDeclaration(sourceDynamicAttributes.getAllParameters(), "type"), toMetadataType(String.class));
messageSources = declaration.getMessageSources();
SourceDeclaration sourceStaticAttributes = getDeclaration(messageSources, "MetadataSourceWithMultilevel");
assertOutputType(sourceStaticAttributes.getOutput(), TYPE_BUILDER.objectType().with(new ClassInformationAnnotation(Map.class, asList(String.class, Object.class))).openWith(TYPE_LOADER.load(Object.class)).build(), true);
assertOutputType(sourceStaticAttributes.getOutputAttributes(), toMetadataType(StringAttributes.class), false);
List<ParameterDeclaration> locationKey = sourceStaticAttributes.getAllParameters();
assertParameterType(getDeclaration(locationKey, "continent"), toMetadataType(String.class));
assertParameterType(getDeclaration(locationKey, "country"), toMetadataType(String.class));
assertParameterType(getDeclaration(locationKey, "city"), toMetadataType(String.class));
}
Aggregations