use of org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor in project mule by mulesoft.
the class MetadataOperationTestCase method pagedOperationMetadataTestCase.
@Test
public void pagedOperationMetadataTestCase() throws Exception {
location = Location.builder().globalName(PAGED_OPERATION_METADATA).addProcessorsPart().addIndexPart(0).build();
ComponentMetadataDescriptor metadataDescriptor = getSuccessComponentDynamicMetadata(NULL_METADATA_KEY);
final ComponentModel typedModel = metadataDescriptor.getModel();
assertExpectedType(getParameter(typedModel, "animal"), Animal.class);
}
use of org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor in project mule by mulesoft.
the class QueryMetadataTestCase method getNativeQueryOutputMetadata.
@Test
public void getNativeQueryOutputMetadata() throws Exception {
location = builder().globalName(NATIVE_QUERY_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();
assertCircleType((ObjectType) generatedType);
}
use of org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor in project mule by mulesoft.
the class QueryMetadataTestCase method getDsqlQueryAutomaticGeneratedOutputMetadata.
@Test
public void getDsqlQueryAutomaticGeneratedOutputMetadata() throws Exception {
location = QUERY_LOCATION;
MetadataKey dsqlKey = newKey(DSQL_QUERY).build();
MetadataResult<ComponentMetadataDescriptor<OperationModel>> entityMetadata = getComponentDynamicMetadata(dsqlKey);
assertThat(entityMetadata.isSuccess(), is(true));
MetadataType generatedType = entityMetadata.get().getModel().getOutput().getType();
assertThat(generatedType, is(instanceOf(ArrayType.class)));
assertCircleType((ObjectType) ((ArrayType) generatedType).getType());
}
use of org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor in project mule by mulesoft.
the class MetadataExtensionFunctionalTestCase method getSuccessComponentDynamicMetadata.
private ComponentMetadataDescriptor<T> getSuccessComponentDynamicMetadata(MetadataKey key, BiConsumer<MetadataResult<ComponentMetadataDescriptor<T>>, MetadataKey> assertKeys) {
MetadataResult<ComponentMetadataDescriptor<T>> componentMetadata = getComponentDynamicMetadata(key);
String msg = componentMetadata.getFailures().stream().map(f -> "Failure: " + f.getMessage()).collect(joining(", "));
assertThat(msg, componentMetadata.isSuccess(), is(true));
assertKeys.accept(componentMetadata, key);
return componentMetadata.get();
}
use of org.mule.runtime.api.metadata.descriptor.ComponentMetadataDescriptor in project mule by mulesoft.
the class MetadataNoRefDynamicConfigurationTestCase method resolveMetadataWithNoRefDynamicConfig.
@Test
public void resolveMetadataWithNoRefDynamicConfig() throws Exception {
location = builder().globalName(RESOLVER_WITH_IMPLICIT_DYNAMIC_CONFIG).addProcessorsPart().addIndexPart(0).build();
MetadataKey key = newKey(AMERICA).withChild(newKey(USA).withChild(newKey(SAN_FRANCISCO))).build();
final MetadataResult<ComponentMetadataDescriptor<OperationModel>> metadataResult = getComponentDynamicMetadata(key);
assertFailureResult(metadataResult, 1);
assertMetadataFailure(metadataResult.getFailures().get(0), "Configuration used for Metadata fetch cannot be dynamic", INVALID_CONFIGURATION, MetadataResolvingException.class.getName(), COMPONENT, "");
}
Aggregations