use of org.mule.runtime.core.api.management.stats.RouterStatistics in project mule by mulesoft.
the class ChoiceRouterTestCase method testMatchingRouteWithStatistics.
@Test
public void testMatchingRouteWithStatistics() throws Exception {
choiceRouter.addRoute(payloadZapExpression(), newChain(empty(), new TestMessageProcessor("bar")));
choiceRouter.setRouterStatistics(new RouterStatistics(TYPE_OUTBOUND));
choiceRouter.setMuleContext(muleContext);
choiceRouter.initialise();
assertThat(process(choiceRouter, zapEvent()).getMessage().getPayload().getValue(), is("zap:bar"));
}
use of org.mule.runtime.core.api.management.stats.RouterStatistics in project mule by mulesoft.
the class ChoiceRouterTestCase method testAddAndDeleteRoute.
@Test
public void testAddAndDeleteRoute() throws Exception {
MessageProcessorChain mp = newChain(empty(), new TestMessageProcessor("bar"));
choiceRouter.addRoute(payloadZapExpression(), mp);
choiceRouter.removeRoute(mp);
choiceRouter.setRouterStatistics(new RouterStatistics(TYPE_OUTBOUND));
choiceRouter.setMuleContext(muleContext);
choiceRouter.initialise();
CoreEvent inputEvent = zapEvent();
assertThat(process(choiceRouter, inputEvent), is(inputEvent));
}
Aggregations