public void testRouteNewMessageAction() throws Exception {
MockEndpoint outboundEndpoint = getProcessedMessagesEndpoint(15);
MockEndpoint failedEndpoint = getFailedMessagesEndpoint(0);
MockProcessor processor = new MockProcessor();
ConnectorService processorService = new MockConnectorService("test", processor, resourceRegistry);
Action action1 = Mockito.mock(Action.class);
Action action2 = new SplitterAction(5, true);
Action action3 = Mockito.mock(Action.class);
// duplicates the messages that arrive and generates 5 more as it wont stop the ones that arrived
Action action4 = new SplitterAction(2, false);
Action action5 = Mockito.mock(Action.class);
processorService
.addPreProcessingAction(action1)
.addPreProcessingAction(action2)
.addPreProcessingAction(action3)
.addPreProcessingAction(action4)
.addPreProcessingAction(action5);
processorService.start();
simulateMessage(new Message(), "activemq:mokai-test");
outboundEndpoint.assertIsSatisfied(5000);
failedEndpoint.assertIsSatisfied(DEFAULT_TIMEOUT);