Search in sources :

Example 11 with DefaultObjectBuilder

use of org.mule.runtime.module.extension.internal.runtime.objectbuilder.DefaultObjectBuilder in project mule by mulesoft.

the class DefaultObjectBuilderTestCase method abstractClass.

@Test(expected = IllegalArgumentException.class)
public void abstractClass() throws Exception {
    builder = new DefaultObjectBuilder(TestAbstract.class);
    builder.build(resolvingContext);
}
Also used : DefaultObjectBuilder(org.mule.runtime.module.extension.internal.runtime.objectbuilder.DefaultObjectBuilder) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Example 12 with DefaultObjectBuilder

use of org.mule.runtime.module.extension.internal.runtime.objectbuilder.DefaultObjectBuilder in project mule by mulesoft.

the class DefaultObjectBuilderTestCase method noDefaultConstructor.

@Test(expected = IllegalArgumentException.class)
public void noDefaultConstructor() throws Exception {
    builder = new DefaultObjectBuilder(TestNoDefaultConstructor.class);
    builder.build(resolvingContext);
}
Also used : DefaultObjectBuilder(org.mule.runtime.module.extension.internal.runtime.objectbuilder.DefaultObjectBuilder) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Example 13 with DefaultObjectBuilder

use of org.mule.runtime.module.extension.internal.runtime.objectbuilder.DefaultObjectBuilder in project mule by mulesoft.

the class DefaultObjectBuilderTestCase method before.

@Before
public void before() {
    builder = new DefaultObjectBuilder(PROTOTYPE_CLASS);
    nameField = getField(PROTOTYPE_CLASS, "name", reflectionCache).get();
    ageField = getField(PROTOTYPE_CLASS, "age", reflectionCache).get();
    when(resolvingContext.getEvent()).thenReturn(event);
    when(resolvingContext.getConfig()).thenReturn(empty());
}
Also used : DefaultObjectBuilder(org.mule.runtime.module.extension.internal.runtime.objectbuilder.DefaultObjectBuilder) Before(org.junit.Before)

Aggregations

DefaultObjectBuilder (org.mule.runtime.module.extension.internal.runtime.objectbuilder.DefaultObjectBuilder)13 Test (org.junit.Test)4 SmallTest (org.mule.tck.size.SmallTest)4 StaticValueResolver (org.mule.runtime.module.extension.internal.runtime.resolver.StaticValueResolver)3 Field (java.lang.reflect.Field)2 ObjectType (org.mule.metadata.api.model.ObjectType)2 MuleException (org.mule.runtime.api.exception.MuleException)2 MuleRuntimeException (org.mule.runtime.api.exception.MuleRuntimeException)2 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)2 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)2 BaseEventContext (org.mule.runtime.core.privileged.event.BaseEventContext)2 String.format (java.lang.String.format)1 Collections.emptyList (java.util.Collections.emptyList)1 LinkedHashMap (java.util.LinkedHashMap)1 Optional (java.util.Optional)1 Collectors.joining (java.util.stream.Collectors.joining)1 StringUtils.isBlank (org.apache.commons.lang3.StringUtils.isBlank)1 Before (org.junit.Before)1 TypeIdAnnotation (org.mule.metadata.api.annotation.TypeIdAnnotation)1 BaseTypeBuilder (org.mule.metadata.api.builder.BaseTypeBuilder)1