use of org.mule.runtime.extension.api.model.ImmutableOutputModel 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.extension.api.model.ImmutableOutputModel in project mule by mulesoft.
the class MetadataComponentModelValidatorTestCase method sourceReturnsDictionaryType.
@Test
public void sourceReturnsDictionaryType() {
exception.expect(IllegalModelDefinitionException.class);
when(sourceModel.getOutput()).thenReturn(new ImmutableOutputModel("", dictionaryType, false, emptySet()));
validate(extensionModel, validator);
}
use of org.mule.runtime.extension.api.model.ImmutableOutputModel in project mule by mulesoft.
the class MetadataComponentModelValidatorTestCase method sourceReturnsArrayTypeOfObjectWithoutDefinedOutputResolver.
@Test
public void sourceReturnsArrayTypeOfObjectWithoutDefinedOutputResolver() {
arrayType = typeBuilder.arrayType().of(toMetadataType(Object.class)).build();
exception.expect(IllegalModelDefinitionException.class);
when(sourceModel.getOutput()).thenReturn(new ImmutableOutputModel("", arrayType, false, emptySet()));
validate(extensionModel, validator);
}
use of org.mule.runtime.extension.api.model.ImmutableOutputModel 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.extension.api.model.ImmutableOutputModel 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);
}
Aggregations