use of org.mule.test.subtypes.extension.NoReferencePojo in project mule by mulesoft.
the class SubTypesMappingParserTestCase method subtypedAndConcreteParameters.
@Test
public void subtypedAndConcreteParameters() throws Exception {
CoreEvent responseEvent = flowRunner("subtypedAndConcreteParameters").withPayload("").run();
assertThat(responseEvent.getMessage().getPayload().getValue(), notNullValue());
List<Object> payload = (List<Object>) responseEvent.getMessage().getPayload().getValue();
assertThat(payload, hasSize(7));
assertThat(payload.get(0), instanceOf(ParentShape.class));
assertThat(((ParentShape) payload.get(0)).getArea(), is(2));
assertThat(payload.get(1), instanceOf(HouseDoor.class));
assertThat(((HouseDoor) payload.get(1)).isLocked(), is(false));
assertThat(payload.get(2), instanceOf(FinalPojo.class));
assertThat(((FinalPojo) payload.get(2)).getSomeString(), is("asChild"));
assertThat(payload.get(3), instanceOf(VeganCookBook.class));
assertThat(((VeganCookBook) payload.get(3)).getNumberOfPages(), is(1));
assertThat(payload.get(4), instanceOf(Square.class));
assertThat(((Square) payload.get(4)).getSide(), is(4));
assertThat(((Square) payload.get(4)).getArea(), is(16));
assertThat(payload.get(5), instanceOf(Triangle.class));
assertThat(((Triangle) payload.get(5)).getHeight(), is(4));
assertThat(((Triangle) payload.get(5)).getArea(), is(2));
assertThat(payload.get(6), instanceOf(NoReferencePojo.class));
assertThat(((NoReferencePojo) payload.get(6)).getNumber(), is(1));
assertThat(((NoReferencePojo) payload.get(6)).getString(), is("noRef"));
}
Aggregations