use of org.mule.runtime.api.metadata.MetadataKeysContainer in project mule by mulesoft.
the class MetadataOperationTestCase method shouldInheritOperationResolvers.
@Test
public void shouldInheritOperationResolvers() throws Exception {
location = Location.builder().globalName(SHOULD_INHERIT_OPERATION_PARENT_RESOLVERS).addProcessorsPart().addIndexPart(0).build();
final MetadataResult<MetadataKeysContainer> metadataKeysResult = metadataService.getMetadataKeys(location);
assertSuccessResult(metadataKeysResult);
final Set<MetadataKey> metadataKeys = getKeysFromContainer(metadataKeysResult.get());
assertThat(metadataKeys.size(), is(3));
assertThat(metadataKeys, hasItems(metadataKeyWithId(PERSON), metadataKeyWithId(CAR), metadataKeyWithId(HOUSE)));
final ComponentMetadataDescriptor<OperationModel> metadataDescriptor = getSuccessComponentDynamicMetadata(PERSON_METADATA_KEY);
final OperationModel typedModel = metadataDescriptor.getModel();
assertExpectedOutput(typedModel, personType, void.class);
assertExpectedType(getParameter(typedModel, "type"), String.class);
// TODO MULE-14190: Revamp MetadataScope annotation
// assertExpectedType(getParameter(typedModel, "content"), personType, true);
}
use of org.mule.runtime.api.metadata.MetadataKeysContainer in project mule by mulesoft.
the class MetadataOperationTestCase method shouldInheritExtensionResolvers.
@Test
@Ignore("MULE-14190: Revamp MetadataScope annotation")
public void shouldInheritExtensionResolvers() throws Exception {
location = Location.builder().globalName(SHOULD_INHERIT_EXTENSION_RESOLVERS).addProcessorsPart().addIndexPart(0).build();
final MetadataResult<MetadataKeysContainer> metadataKeysResult = metadataService.getMetadataKeys(location);
assertSuccessResult(metadataKeysResult);
final Set<MetadataKey> metadataKeys = getKeysFromContainer(metadataKeysResult.get());
assertThat(metadataKeys.size(), is(1));
assertThat(metadataKeys, hasItems(metadataKeyWithId("APPLE")));
final ComponentMetadataDescriptor<OperationModel> metadataDescriptor = getSuccessComponentDynamicMetadataWithKey(newKey("APPLE").build());
final OperationModel typedModel = metadataDescriptor.getModel();
assertExpectedOutput(typedModel, typeLoader.load(Apple.class), void.class);
}
use of org.mule.runtime.api.metadata.MetadataKeysContainer in project mule by mulesoft.
the class QueryMetadataTestCase method getEntityKeys.
@Test
public void getEntityKeys() throws Exception {
MetadataResult<MetadataKeysContainer> metadataKeysResult = metadataService.getEntityKeys(QUERY_LOCATION);
assertThat(metadataKeysResult.isSuccess(), is(true));
MetadataKeysContainer container = metadataKeysResult.get();
Set<MetadataKey> metadataKeys = container.getKeys(container.getCategories().iterator().next()).get();
assertThat(metadataKeys.size(), is(2));
assertThat(metadataKeys, hasItems(metadataKeyWithId(CIRCLE), metadataKeyWithId(SQUARE)));
}
Aggregations