use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class MetadataOperationTestCase method contentMetadataWithoutKeysWithKeyId.
@Test
public void contentMetadataWithoutKeysWithKeyId() throws Exception {
location = Location.builder().globalName(CONTENT_METADATA_WITHOUT_KEYS_WITH_KEY_ID).addProcessorsPart().addIndexPart(0).build();
final ComponentMetadataDescriptor<OperationModel> metadataDescriptor = getSuccessComponentDynamicMetadataWithKey(PERSON_METADATA_KEY);
final OperationModel typedModel = metadataDescriptor.getModel();
assertExpectedOutput(typedModel, void.class, void.class);
assertExpectedType(getParameter(typedModel, "type"), String.class);
assertExpectedType(getParameter(typedModel, "content"), personType, true);
}
use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class MetadataOperationTestCase method pagedOperationResultWithAttributeResolverMetadataTestCase.
@Test
public void pagedOperationResultWithAttributeResolverMetadataTestCase() throws Exception {
location = Location.builder().globalName(PAGED_OPERATION_METADATA_RESULT_WITH_ATTRIBUTES).addProcessorsPart().addIndexPart(0).build();
ComponentMetadataDescriptor<OperationModel> metadataDescriptor = getSuccessComponentDynamicMetadata(PERSON_METADATA_KEY);
MetadataType param = metadataDescriptor.getModel().getOutput().getType();
assertThat(param, is(instanceOf(ArrayType.class)));
assertThat(getId(param).get(), is(Iterator.class.getName()));
assertMessageType(((ArrayType) param).getType(), personType, personType);
}
use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class MetadataOperationTestCase method dynamicContentWithoutKeyId.
@Test
public void dynamicContentWithoutKeyId() throws Exception {
location = Location.builder().globalName(CONTENT_METADATA_WITHOUT_KEY_ID).addProcessorsPart().addIndexPart(0).build();
final ComponentMetadataDescriptor<OperationModel> metadataDescriptor = getSuccessComponentDynamicMetadata(NULL_METADATA_KEY);
final OperationModel typedModel = metadataDescriptor.getModel();
assertExpectedOutput(typedModel, typeBuilder.anyType().build(), void.class);
assertExpectedType(getParameter(typedModel, "content"), personType, true);
}
use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class MetadataOperationTestCase method getContentMetadataWithKey.
@Test
public void getContentMetadataWithKey() throws Exception {
location = Location.builder().globalName(CONTENT_METADATA_WITH_KEY_ID).addProcessorsPart().addIndexPart(0).build();
final ComponentMetadataDescriptor<OperationModel> metadataDescriptor = getSuccessComponentDynamicMetadataWithKey(PERSON_METADATA_KEY);
final OperationModel typedModel = metadataDescriptor.getModel();
assertExpectedOutput(typedModel, typeBuilder.anyType().build(), void.class);
assertExpectedType(getParameter(typedModel, "type"), String.class);
assertExpectedType(getParameter(typedModel, "content"), personType, true);
}
use of org.mule.runtime.api.meta.model.operation.OperationModel in project mule by mulesoft.
the class MetadataOperationTestCase method messageAttributesVoidTypeMetadata.
@Test
public void messageAttributesVoidTypeMetadata() throws Exception {
location = Location.builder().globalName(MESSAGE_ATTRIBUTES_ANY_TYPE_METADATA).addProcessorsPart().addIndexPart(0).build();
final ComponentMetadataDescriptor<OperationModel> metadataDescriptor = getSuccessComponentDynamicMetadata(NULL_METADATA_KEY);
final OperationModel typedModel = metadataDescriptor.getModel();
assertExpectedOutput(typedModel, ExtensionsTestUtils.TYPE_BUILDER.anyType().build(), ExtensionsTestUtils.TYPE_BUILDER.anyType().build());
assertExpectedType(getParameter(typedModel, TARGET_PARAMETER_NAME), String.class);
}
Aggregations