Search in sources :

Example 1 with ChoiceRouter

use of org.mule.runtime.core.internal.routing.ChoiceRouter in project mule by mulesoft.

the class DefaultMessageProcessorChainTestCase method testChoice.

@Test
public void testChoice() throws Exception {
    ChoiceRouter choiceRouter = new ChoiceRouter();
    choiceRouter.setAnnotations(getAppleFlowComponentLocationAnnotations());
    choiceRouter.setAnnotations(singletonMap(LOCATION_KEY, TEST_CONNECTOR_LOCATION));
    choiceRouter.addRoute("true", newChain(empty(), getAppendingMP("1")));
    choiceRouter.addRoute("true", newChain(empty(), getAppendingMP("2")));
    choiceRouter.addRoute("true", newChain(empty(), getAppendingMP("3")));
    initialiseIfNeeded(choiceRouter, muleContext);
    assertThat(process(newChain(empty(), choiceRouter), getTestEventUsingFlow("0")).getMessage().getPayload().getValue(), equalTo("01"));
}
Also used : ChoiceRouter(org.mule.runtime.core.internal.routing.ChoiceRouter) SmallTest(org.mule.tck.size.SmallTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 ChoiceRouter (org.mule.runtime.core.internal.routing.ChoiceRouter)1 SmallTest (org.mule.tck.size.SmallTest)1