use of org.mule.test.subtypes.extension.SubTypesMappingConnector in project mule by mulesoft.
the class SubTypesMappingParserTestCase method configRetriever.
@Test
public void configRetriever() throws Exception {
CoreEvent responseEvent = flowRunner("configRetriever").withPayload("").run();
assertThat(responseEvent.getMessage().getPayload().getValue(), instanceOf(SubTypesMappingConnector.class));
SubTypesMappingConnector payload = (SubTypesMappingConnector) responseEvent.getMessage().getPayload().getValue();
assertThat(payload.getAbstractShape(), instanceOf(Square.class));
assertThat(payload.getAbstractShape().getArea(), is(1));
assertThat(payload.getExplicitSquare(), instanceOf(Square.class));
assertThat(payload.getExplicitSquare().getArea(), is(4));
assertThat(payload.getDoorInterface(), instanceOf(CarDoor.class));
assertThat(payload.getFinalPojo(), instanceOf(FinalPojo.class));
assertThat(payload.getRicin(), instanceOf(Ricin.class));
assertThat(payload.getTriangle(), instanceOf(Triangle.class));
assertThat(payload.getOnePojos(), is(notNullValue()));
assertThat(payload.getOnePojos(), hasSize(1));
assertThat(payload.getOnePojos().get(0), instanceOf(PojoForList.class));
assertThat(payload.getOnePojos().get(0).getId(), is("inner"));
assertThat(payload.getWeapons(), is(notNullValue()));
assertThat(payload.getWeapons(), hasSize(4));
assertRevolver(payload.getWeapons().get(0), 6);
assertRicin(payload.getWeapons().get(1), 10L, "Krazy-8");
assertRicin(payload.getWeapons().get(2), 20L, "Lidia");
assertRevolver(payload.getWeapons().get(3), 0);
assertThat(payload.getWeaponMap(), is(notNullValue()));
assertThat(payload.getWeaponMap().entrySet(), hasSize(3));
assertRicin(payload.getWeaponMap().get("ricinChild"), 20L, "Lidia");
assertRevolver(payload.getWeaponMap().get("revolverChild"), 1);
assertRevolver(payload.getWeaponMap().get("revolverMEL"), 0);
}
Aggregations