@Test
public void embeddedFilterShouldCreatePairWithFilterAndOtherConfiguredMPsAsChain()
{
ChoiceRouter router = findChoiceRouterInFlow("with-default-route");
MessageProcessorFilterPair firstPair = router.getConditionalMessageProcessors().get(0);
assertIsRegExFilterWithPattern(firstPair.getFilter(), "apple");
assertMessageChainIsOutboundEndpoint(firstPair.getMessageProcessor(), "vm://fruit-channel.in");
MessageProcessorFilterPair secondPair = router.getConditionalMessageProcessors().get(1);
assertIsRegExFilterWithPattern(secondPair.getFilter(), "turnip");
assertMessageChainIsOutboundEndpoint(secondPair.getMessageProcessor(), "vm://veggie-channel.in");
MessageProcessorFilterPair thirdPair = router.getConditionalMessageProcessors().get(2);
assertIsExpressionFilterWithExpressionAndEvaluator(thirdPair.getFilter(), ".*berry", "regex");
assertMessageChainIsOutboundEndpoint(thirdPair.getMessageProcessor(), "vm://fruit-channel.in");
}