use of org.mule.runtime.core.internal.metadata.DefaultMetadataResolverFactory in project mule by mulesoft.
the class MetadataComponentModelValidatorTestCase method sourceReturnsObjectTypeWithDefinedOutputResolver.
@Test
public void sourceReturnsObjectTypeWithDefinedOutputResolver() {
when(sourceModel.getOutput()).thenReturn(new ImmutableOutputModel(EMPTY, toMetadataType(Object.class), false, emptySet()));
mockMetadataResolverFactory(sourceModel, new DefaultMetadataResolverFactory(NULL_RESOLVER_SUPPLIER, emptyMap(), SIMPLE_OUTPUT_RESOLVER, NULL_RESOLVER_SUPPLIER));
validate(extensionModel, validator);
}
use of org.mule.runtime.core.internal.metadata.DefaultMetadataResolverFactory in project mule by mulesoft.
the class MetadataComponentModelValidatorTestCase method operationReturnsDictionaryTypeWithPojoValue.
@Test
public void operationReturnsDictionaryTypeWithPojoValue() {
dictionaryType = typeBuilder.objectType().openWith(toMetadataType(Apple.class)).build();
when(operationModel.getOutput()).thenReturn(new ImmutableOutputModel("", dictionaryType, false, emptySet()));
mockMetadataResolverFactory(sourceModel, new DefaultMetadataResolverFactory(MOCK_RESOLVER_SUPPLIER, emptyMap(), MOCK_RESOLVER_SUPPLIER, NULL_RESOLVER_SUPPLIER));
validate(extensionModel, validator);
}
use of org.mule.runtime.core.internal.metadata.DefaultMetadataResolverFactory in project mule by mulesoft.
the class MetadataComponentModelValidatorTestCase method sourceReturnsDictionaryTypeWithDefinedOutputResolver.
@Test
public void sourceReturnsDictionaryTypeWithDefinedOutputResolver() {
when(sourceModel.getOutput()).thenReturn(new ImmutableOutputModel("", dictionaryType, false, emptySet()));
mockMetadataResolverFactory(sourceModel, new DefaultMetadataResolverFactory(NULL_RESOLVER_SUPPLIER, emptyMap(), SIMPLE_OUTPUT_RESOLVER, NULL_RESOLVER_SUPPLIER));
validate(extensionModel, validator);
}
use of org.mule.runtime.core.internal.metadata.DefaultMetadataResolverFactory in project mule by mulesoft.
the class MetadataComponentModelValidatorTestCase method sourceReturnsPojoType.
@Test
public void sourceReturnsPojoType() {
mockMetadataResolverFactory(sourceModel, new DefaultMetadataResolverFactory(MOCK_RESOLVER_SUPPLIER, emptyMap(), MOCK_RESOLVER_SUPPLIER, NULL_RESOLVER_SUPPLIER));
when(sourceModel.getOutput()).thenReturn(new ImmutableOutputModel(EMPTY, toMetadataType(Apple.class), false, emptySet()));
validate(extensionModel, validator);
}
use of org.mule.runtime.core.internal.metadata.DefaultMetadataResolverFactory in project mule by mulesoft.
the class MetadataComponentModelValidatorTestCase method operationWithAttributeResolverButNoAttributes.
@Test
public void operationWithAttributeResolverButNoAttributes() {
exception.expect(IllegalModelDefinitionException.class);
when(extensionModel.getSourceModels()).thenReturn(emptyList());
mockMetadataResolverFactory(operationModel, new DefaultMetadataResolverFactory(NULL_RESOLVER_SUPPLIER, emptyMap(), SIMPLE_OUTPUT_RESOLVER, SIMPLE_OUTPUT_RESOLVER));
when(operationModel.getModelProperty(MetadataKeyIdModelProperty.class)).thenReturn(empty());
when(operationModel.getOutput()).thenReturn(new ImmutableOutputModel(EMPTY, toMetadataType(Object.class), false, emptySet()));
when(operationModel.getOutputAttributes()).thenReturn(new ImmutableOutputModel(EMPTY, toMetadataType(void.class), false, emptySet()));
validate(extensionModel, validator);
}
Aggregations