use of org.mule.test.marvel.model.Villain in project mule by mulesoft.
the class NonBlockingOperationsTestCase method fireMissileAndAssert.
private void fireMissileAndAssert(String flowName) throws Exception {
Villain villain = new Villain();
String result = (String) flowRunner(flowName).withPayload(villain).run().getMessage().getPayload().getValue();
assertThat(villain.isAlive(), is(false));
assertThat(result, is(KABOOM));
}
use of org.mule.test.marvel.model.Villain in project mule by mulesoft.
the class OperationReconnectionTestCase method defaultReconnection.
@Test
public void defaultReconnection() throws Exception {
final Villain villain = new Villain();
flowRunner("defaultReconnection").withPayload(villain).runExpectingException();
assertThat(villain.isAlive(), is(true));
IronMan stark = getIronMan();
assertThat(stark.getMissilesFired(), is(1));
}
use of org.mule.test.marvel.model.Villain in project mule by mulesoft.
the class OperationReconnectionTestCase method operationReconnection.
@Test
public void operationReconnection() throws Exception {
final Villain villain = new Villain();
flowRunner("operationReconnection").withPayload(villain).run();
assertThat(villain.isAlive(), is(false));
IronMan stark = getIronMan();
assertThat(stark.getMissilesFired(), is(2));
}
use of org.mule.test.marvel.model.Villain in project mule by mulesoft.
the class NonBlockingOperationsTestCase method failingNonBlockingConnectedOperation.
@Test
public void failingNonBlockingConnectedOperation() throws Exception {
expectedException.expectFailingComponent(is(locator.find(Location.builder().globalName("fireMissile").addProcessorsPart().addIndexPart(1).build()).get()));
expectedException.expectMessage(is(MISSILE_PROOF));
expectedException.expectCause(instanceOf(UnsupportedOperationException.class));
Villain villain = new MissileProofVillain();
flowRunner("fireMissile").withPayload(villain).run();
assertThat(villain.isAlive(), is(true));
}
Aggregations