Search in sources :

Example 26 with ParameterDeclaration

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);
}
Also used : ExtensionDeclaration(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration) ParameterDeclaration(org.mule.runtime.api.meta.model.declaration.fluent.ParameterDeclaration) Test(org.junit.Test)

Example 27 with ParameterDeclaration

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);
}
Also used : ExtensionDeclaration(org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration) OperationDeclaration(org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration) ParameterDeclaration(org.mule.runtime.api.meta.model.declaration.fluent.ParameterDeclaration) Test(org.junit.Test)

Example 28 with ParameterDeclaration

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));
}
Also used : StringAttributes(org.mule.tck.message.StringAttributes) ClassInformationAnnotation(org.mule.metadata.java.api.annotation.ClassInformationAnnotation) ParameterDeclaration(org.mule.runtime.api.meta.model.declaration.fluent.ParameterDeclaration) SourceDeclaration(org.mule.runtime.api.meta.model.declaration.fluent.SourceDeclaration) Test(org.junit.Test)

Aggregations

ParameterDeclaration (org.mule.runtime.api.meta.model.declaration.fluent.ParameterDeclaration)28 Test (org.junit.Test)18 ExtensionDeclaration (org.mule.runtime.api.meta.model.declaration.fluent.ExtensionDeclaration)15 OperationDeclaration (org.mule.runtime.api.meta.model.declaration.fluent.OperationDeclaration)9 ConfigurationDeclaration (org.mule.runtime.api.meta.model.declaration.fluent.ConfigurationDeclaration)4 ParameterGroupDeclaration (org.mule.runtime.api.meta.model.declaration.fluent.ParameterGroupDeclaration)3 PathModel (org.mule.runtime.api.meta.model.display.PathModel)3 List (java.util.List)2 ClassTypeLoader (org.mule.metadata.api.ClassTypeLoader)2 MetadataType (org.mule.metadata.api.model.MetadataType)2 ObjectType (org.mule.metadata.api.model.ObjectType)2 StringType (org.mule.metadata.api.model.StringType)2 ClassInformationAnnotation (org.mule.metadata.java.api.annotation.ClassInformationAnnotation)2 ImportedTypeModel (org.mule.runtime.api.meta.model.ImportedTypeModel)2 ConnectionProviderDeclaration (org.mule.runtime.api.meta.model.declaration.fluent.ConnectionProviderDeclaration)2 SourceDeclaration (org.mule.runtime.api.meta.model.declaration.fluent.SourceDeclaration)2 ClassValueModel (org.mule.runtime.api.meta.model.display.ClassValueModel)2 Reference (org.mule.runtime.api.util.Reference)2 IdempotentDeclarationWalker (org.mule.runtime.extension.api.declaration.fluent.util.IdempotentDeclarationWalker)2 BigDecimal (java.math.BigDecimal)1