Search in sources :

Example 26 with ArrayType

use of org.mule.metadata.api.model.ArrayType in project mule by mulesoft.

the class QueryMetadataTestCase method getNativeQueryOutputArrayMetadata.

@Test
public void getNativeQueryOutputArrayMetadata() throws Exception {
    location = builder().globalName(NATIVE_QUERY_LIST_FLOW).addProcessorsPart().addIndexPart(0).build();
    MetadataKey nativeKey = newKey(NATIVE_QUERY).build();
    MetadataResult<ComponentMetadataDescriptor<OperationModel>> entityMetadata = getComponentDynamicMetadata(nativeKey);
    assertThat(entityMetadata.isSuccess(), is(true));
    MetadataType generatedType = entityMetadata.get().getModel().getOutput().getType();
    assertThat(generatedType, is(instanceOf(ArrayType.class)));
    assertCircleType((ObjectType) ((ArrayType) generatedType).getType());
}
Also used : ArrayType(org.mule.metadata.api.model.ArrayType) ExtensionsTestUtils.toMetadataType(org.mule.test.module.extension.internal.util.ExtensionsTestUtils.toMetadataType) MetadataType(org.mule.metadata.api.model.MetadataType) MetadataKey(org.mule.runtime.api.metadata.MetadataKey) ComponentMetadataDescriptor(org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor) Test(org.junit.Test)

Aggregations

ArrayType (org.mule.metadata.api.model.ArrayType)26 MetadataType (org.mule.metadata.api.model.MetadataType)25 ObjectType (org.mule.metadata.api.model.ObjectType)20 MetadataTypeVisitor (org.mule.metadata.api.visitor.MetadataTypeVisitor)17 Optional (java.util.Optional)14 ObjectFieldType (org.mule.metadata.api.model.ObjectFieldType)13 ExtensionModel (org.mule.runtime.api.meta.model.ExtensionModel)13 String.format (java.lang.String.format)12 List (java.util.List)12 ParameterGroupModel (org.mule.runtime.api.meta.model.parameter.ParameterGroupModel)12 ParameterModel (org.mule.runtime.api.meta.model.parameter.ParameterModel)12 Reference (org.mule.runtime.api.util.Reference)12 Map (java.util.Map)11 ParameterizedModel (org.mule.runtime.api.meta.model.parameter.ParameterizedModel)11 Set (java.util.Set)10 Collectors.toList (java.util.stream.Collectors.toList)10 ClassTypeLoader (org.mule.metadata.api.ClassTypeLoader)10 StringType (org.mule.metadata.api.model.StringType)9 DslElementSyntax (org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax)9 ExtensionMetadataTypeUtils.isMap (org.mule.runtime.extension.api.util.ExtensionMetadataTypeUtils.isMap)9