use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class OperationExecutionTestCase method operationWithListPojoAsChildElementsOverridesDefault.
@Test
public void operationWithListPojoAsChildElementsOverridesDefault() throws Exception {
List<Ricin> ricins = (List<Ricin>) flowRunner("killWithRicinAsChildElement").withPayload(EMPTY).run().getMessage().getPayload().getValue();
assertThat(ricins, hasSize(2));
assertThat(ricins.get(0), instanceOf(Ricin.class));
assertThat(ricins.get(1), instanceOf(Ricin.class));
Ricin ricin1 = ricins.get(0);
assertThat(ricin1.getMicrogramsPerKilo(), is(20L));
assertThat(ricin1.getDestination().getVictim(), is("Lidia"));
assertThat(ricin1.getDestination().getAddress(), is("Stevia coffe shop"));
Ricin ricin2 = ricins.get(1);
assertThat(ricin2.getMicrogramsPerKilo(), is(22L));
assertThat(ricin2.getDestination().getVictim(), is("Gustavo Fring"));
assertThat(ricin2.getDestination().getAddress(), is("pollos hermanos"));
}
use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class OperationExecutionTestCase method operationWithListPojoAsDefaultPayload.
@Test
public void operationWithListPojoAsDefaultPayload() throws Exception {
Ricin ricinWeapon1 = new Ricin();
ricinWeapon1.setMicrogramsPerKilo(20L);
Ricin ricinWeapon2 = new Ricin();
ricinWeapon2.setMicrogramsPerKilo(22L);
List<Ricin> ricins = (List<Ricin>) flowRunner("killWithRicinDefaultPayload").withPayload(Arrays.asList(ricinWeapon1, ricinWeapon2)).run().getMessage().getPayload().getValue();
assertThat(ricins, hasSize(2));
assertThat(ricins.get(0), instanceOf(Ricin.class));
assertThat(ricins.get(1), instanceOf(Ricin.class));
Ricin ricin1 = ricins.get(0);
assertThat(ricin1.getMicrogramsPerKilo(), is(20L));
Ricin ricin2 = ricins.get(1);
assertThat(ricin2.getMicrogramsPerKilo(), is(22L));
}
use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class ParameterizedConfigParserTestCase method assertLabeledRicin.
private void assertLabeledRicin(HeisenbergExtension heisenberg) {
Map<String, Ricin> labeledRicin = heisenberg.getRicinGroup().getLabeledRicin();
assertNotNull(labeledRicin);
assertThat(labeledRicin.size(), equalTo(1));
assertThat(labeledRicin.get("pojo"), instanceOf(Ricin.class));
Ricin ricin = labeledRicin.get("pojo");
assertNotNull(ricin);
assertThat(ricin.getMicrogramsPerKilo(), equalTo(MICROGRAMS_PER_KILO));
assertDoor(ricin.getDestination(), LIDIA, STEVIA_COFFE_SHOP);
}
use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class ParameterizedConfigParserTestCase method assertRicinPacks.
private void assertRicinPacks(HeisenbergExtension heisenberg) {
Set<Ricin> ricinPacks = heisenberg.getRicinGroup().getRicinPacks();
assertNotNull(ricinPacks);
assertThat(ricinPacks.size(), equalTo(1));
Ricin ricin = ricinPacks.iterator().next();
assertThat(ricin.getMicrogramsPerKilo(), equalTo(MICROGRAMS_PER_KILO));
assertDoor(ricin.getDestination(), LIDIA, STEVIA_COFFE_SHOP);
}
use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class SubTypesMappingParserTestCase method subtypeContributionToOtherExtension.
@Test
public void subtypeContributionToOtherExtension() throws Exception {
HeisenbergExtension heisenberg = lookupHeisenberg("heisenberg");
assertThat(heisenberg, is(notNullValue()));
List<? extends Weapon> wildCardWeapons = heisenberg.getWildCardWeapons();
assertThat(wildCardWeapons, is(notNullValue()));
assertThat(wildCardWeapons, hasSize(2));
assertThat(wildCardWeapons.get(0), instanceOf(Ricin.class));
assertThat(((Ricin) wildCardWeapons.get(0)).getMicrogramsPerKilo(), is(10L));
assertThat(((Ricin) wildCardWeapons.get(0)).getDestination(), is(notNullValue()));
assertThat(((Ricin) wildCardWeapons.get(0)).getDestination().getVictim(), is("Krazy-8"));
assertThat(wildCardWeapons.get(1), instanceOf(Revolver.class));
assertThat(((Revolver) wildCardWeapons.get(1)).getBullets(), is(3));
}
Aggregations