use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class AbstractHeisenbergConfigTestCase method getStartUpRegistryObjects.
@Override
protected Map<String, Object> getStartUpRegistryObjects() {
final Map<String, Object> objects = new HashMap<>();
objects.put("recipes", ImmutableMap.<String, Long>builder().put("methylamine", 75l).put("pseudoephedrine", 0l).put("P2P", 25l).build());
objects.put("deathsBySeasons", ImmutableMap.<String, List<String>>builder().put("s01", ImmutableList.<String>builder().add("emilio").add("domingo").build()).put("s02", ImmutableList.<String>builder().add("tuco").add("tortuga").build()).build());
Ricin ricin = new Ricin(new KnockeableDoor("Lidia", "Stevia coffe shop"), 22L);
objects.put("labeledRicins", ImmutableMap.<String, Ricin>builder().put("pojo", ricin).build());
objects.put("monthlyIncomes", ImmutableList.<Long>builder().add(12000L).add(500L).build());
objects.put("enemies", ImmutableList.<String>builder().add("Gustavo Fring").add("Hank").build());
objects.put("ricinPacks", ImmutableSet.<Ricin>builder().add(ricin).build());
objects.put("candidateDoors", ImmutableMap.<String, KnockeableDoor>builder().put("skyler", new KnockeableDoor("Skyler", "308 Negra Arroyo Lane")).put("saul", new KnockeableDoor("Saul", "Shopping Mall")).build());
return objects;
}
use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class OperationExecutionTestCase method operationWhichConsumesAListOfNonInstantiableArgument.
@Test
public void operationWhichConsumesAListOfNonInstantiableArgument() throws Exception {
Ricin ricinWeapon1 = new Ricin();
ricinWeapon1.setMicrogramsPerKilo(10L);
Ricin ricinWeapon2 = new Ricin();
ricinWeapon2.setMicrogramsPerKilo(10L);
List<Weapon> weaponList = Arrays.asList(ricinWeapon1, ricinWeapon2);
CoreEvent event = flowRunner("killWithMultipleWeapons").withPayload(EMPTY).withVariable("weapons", weaponList).run();
List<String> result = weaponList.stream().map(Weapon::kill).collect(Collectors.toList());
assertThat(event.getMessage().getPayload().getValue(), is(result));
}
use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class OperationExecutionTestCase method operationWhichConsumesANonInstantiableArgument.
@Test
public void operationWhichConsumesANonInstantiableArgument() throws Exception {
Ricin ricinWeapon = new Ricin();
ricinWeapon.setMicrogramsPerKilo(10L);
CoreEvent event = flowRunner("killWithWeapon").withPayload(EMPTY).withVariable("weapon", ricinWeapon).run();
assertThat(event.getMessage().getPayload().getValue(), is(KILL_RESULT));
}
use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class ExtensionsClientTestCase method executeOperationWithComplexType.
@Test
@Description("Executes an operation with a complex type parameter using the client and the DefaultOperationParametersBuilder")
public void executeOperationWithComplexType() throws Throwable {
Weapon.WeaponAttributes attributes = new Weapon.WeaponAttributes();
attributes.setBrand("brand");
OperationParameters params = builder().configName(HEISENBERG_CONFIG).addParameter("weapon", Ricin.class, builder().addParameter("destination", KnockeableDoor.class, builder().addParameter("address", "ADdresss").addParameter("victim", "victim!1231")).addParameter("microgramsPerKilo", 123L)).addParameter("type", FIRE_WEAPON).addParameter("attributesOfWeapon", attributes).build();
Result<String, Object> result = doExecute(HEISENBERG_EXT_NAME, "killWithWeapon", params);
assertThat(result.getOutput(), is("Killed with: You have been killed with Ricin , Type FIRE_WEAPON and attribute brand"));
}
use of org.mule.test.heisenberg.extension.model.Ricin in project mule by mulesoft.
the class RoutersExecutionTestCase method stereotypedRoutes.
@Test
public void stereotypedRoutes() throws Exception {
Event routeEvent = flowRunner("stereotypedRoutes").run();
Ricin ricin = ((List<Ricin>) routeEvent.getMessage().getPayload().getValue()).get(0);
assertThat(ricin.getDestination().getVictim(), is("bye bye, someName"));
}
Aggregations