use of org.mule.runtime.config.internal.dsl.processor.ObjectTypeVisitor in project mule by mulesoft.
the class ObjectTypeVisitorTestCase method testFailsIfTypeIsNotOfCheckedClass.
@Test
public void testFailsIfTypeIsNotOfCheckedClass() throws ClassNotFoundException {
exception.expect(MuleRuntimeException.class);
exception.expectMessage("is not the same nor inherits from");
ComponentModel componentModel = new SpringComponentModel();
componentModel.setParameter("type", this.getClass().getName());
ObjectTypeVisitor visitor = new ObjectTypeVisitor(componentModel);
TypeDefinition typeDefinition = fromConfigurationAttribute("type").checkingThatIsClassOrInheritsFrom(ReferenceProcessor.class);
typeDefinition.visit(visitor);
}
use of org.mule.runtime.config.internal.dsl.processor.ObjectTypeVisitor in project mule by mulesoft.
the class ObjectTypeVisitorTestCase method typeIsInstanceOfGivenClass.
@Test
public void typeIsInstanceOfGivenClass() {
ObjectTypeVisitor visitor = new ObjectTypeVisitor(new SpringComponentModel());
TypeDefinition typeDefinition = fromType(String.class);
typeDefinition.visit(visitor);
assertTrue(String.class.isAssignableFrom(visitor.getType()));
}
Aggregations