use of org.mule.test.subtypes.extension.CarDoor in project mule by mulesoft.
the class SubTypesMappingParserTestCase method doorRetriever.
@Test
public void doorRetriever() throws Exception {
CoreEvent responseEvent = flowRunner("doorRetriever").withPayload("").run();
assertThat(responseEvent.getMessage().getPayload().getValue(), instanceOf(CarDoor.class));
CarDoor payload = (CarDoor) responseEvent.getMessage().getPayload().getValue();
assertThat(payload.getColor(), is("blue"));
}
use of org.mule.test.subtypes.extension.CarDoor in project mule by mulesoft.
the class SubTypesMappingParserTestCase method subtypedAndConcreteParametersAsAttributes.
@Test
public void subtypedAndConcreteParametersAsAttributes() throws Exception {
CoreEvent responseEvent = flowRunner("subtypedAndConcreteParametersAsAttributes").withPayload("").run();
assertThat(responseEvent.getMessage().getPayload().getValue(), notNullValue());
List<Object> payload = (List<Object>) responseEvent.getMessage().getPayload().getValue();
assertThat(payload, hasSize(7));
assertThat(payload.get(1), instanceOf(CarDoor.class));
assertThat(((CarDoor) payload.get(1)).getColor(), is("white"));
assertThat(payload.get(5), instanceOf(Triangle.class));
assertThat(((Triangle) payload.get(5)).getHeight(), is(6));
assertThat(((Triangle) payload.get(5)).getArea(), is(3));
}