use of org.mule.runtime.api.meta.model.SubTypesModel in project mule by mulesoft.
the class SoapExtensionWithCustomTransportsDeclarationTestCase method assertSubtypes.
private void assertSubtypes(ExtensionModel model) {
SubTypesModel subtypes = model.getSubTypes().iterator().next();
assertThat(getId(subtypes.getBaseType()).get(), is(MessageDispatcherProvider.class.getName()));
subtypes.getSubTypes().forEach(subtype -> assertThat(getId(subtype).get(), isOneOf(TestHttpMessageDispatcherProvider.class.getName(), DefaultPortalGunDispatcherProvider.class.getName(), MiniverseDispatcherProvider.class.getName())));
}
use of org.mule.runtime.api.meta.model.SubTypesModel in project mule by mulesoft.
the class SubtypesModelValidatorTestCase method validSubtypes.
@Test
public void validSubtypes() {
mockSubTypes(extensionModel, new SubTypesModel(toMetadataType(BaseAbstractPojo.class), singleton(toMetadataType(Pojo.class))), new SubTypesModel(toMetadataType(BaseCustomInterface.class), singleton(toMetadataType(Pojo.class))));
when(extensionModel.getImportedTypes()).thenReturn(emptySet());
validate(extensionModel, validator);
}
use of org.mule.runtime.api.meta.model.SubTypesModel in project mule by mulesoft.
the class NameClashModelValidatorTestCase method topLevelParameterClashOnSubtypeWithSameType.
@Test
public void topLevelParameterClashOnSubtypeWithSameType() {
ParameterModel offending = getParameter(TOP_LEVEL_SINGULAR_PARAM_NAME, TopLevelTest.class);
mockParameters(operationModel, offending);
when(extensionModel.getSubTypes()).thenReturn(ImmutableSet.of(new SubTypesModel(toMetadataType(ChildTest.class), ImmutableSet.of(toMetadataType(TopLevelTest.class)))));
validate();
}
use of org.mule.runtime.api.meta.model.SubTypesModel in project mule by mulesoft.
the class SubtypesModelValidatorTestCase method invalidNotSubtypesOfBaseType.
@Test(expected = IllegalModelDefinitionException.class)
public void invalidNotSubtypesOfBaseType() {
mockSubTypes(extensionModel, new SubTypesModel(toMetadataType(BaseCustomInterface.class), ImmutableSet.of(toMetadataType(AbstractPojo.class), toMetadataType(CustomInterface.class))));
when(extensionModel.getImportedTypes()).thenReturn(emptySet());
validate(extensionModel, validator);
}
Aggregations