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"));
}
Aggregations