Search in sources :

Example 1 with IronMan

use of org.mule.test.marvel.ironman.IronMan in project mule by mulesoft.

the class NonBlockingOperationsTestCase method nonBlockingOperationReconnection.

@Test
public void nonBlockingOperationReconnection() throws Exception {
    fireMissileAndAssert("warMachineFireMissile");
    IronMan warMachine = getIronMan("warMachine");
    assertThat(warMachine.getMissilesFired(), is(2));
}
Also used : IronMan(org.mule.test.marvel.ironman.IronMan) Test(org.junit.Test)

Example 2 with IronMan

use of org.mule.test.marvel.ironman.IronMan 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));
}
Also used : Villain(org.mule.test.marvel.model.Villain) IronMan(org.mule.test.marvel.ironman.IronMan) Test(org.junit.Test)

Example 3 with IronMan

use of org.mule.test.marvel.ironman.IronMan 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));
}
Also used : Villain(org.mule.test.marvel.model.Villain) IronMan(org.mule.test.marvel.ironman.IronMan) Test(org.junit.Test)

Example 4 with IronMan

use of org.mule.test.marvel.ironman.IronMan in project mule by mulesoft.

the class NonBlockingOperationsTestCase method voidNonBlockingOperation.

@Test
public void voidNonBlockingOperation() throws Exception {
    IronMan ironMan = getIronMan("ironMan");
    final String payload = "take me to the avengers tower";
    Event event = flowRunner("computeFlightPlan").withPayload(payload).run();
    assertThat(event.getMessage().getPayload().getValue().toString(), equalTo(payload));
    new PollingProber().probe(1000, 1000, () -> FLIGHT_PLAN.equals(ironMan.getFlightPlan()));
}
Also used : PollingProber(org.mule.tck.probe.PollingProber) CoreEvent(org.mule.runtime.core.api.event.CoreEvent) Event(org.mule.runtime.api.event.Event) MuleExtensionUtils.getInitialiserEvent(org.mule.runtime.module.extension.api.util.MuleExtensionUtils.getInitialiserEvent) IronMan(org.mule.test.marvel.ironman.IronMan) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 IronMan (org.mule.test.marvel.ironman.IronMan)4 Villain (org.mule.test.marvel.model.Villain)2 Event (org.mule.runtime.api.event.Event)1 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)1 MuleExtensionUtils.getInitialiserEvent (org.mule.runtime.module.extension.api.util.MuleExtensionUtils.getInitialiserEvent)1 PollingProber (org.mule.tck.probe.PollingProber)1