use of org.apache.camel.processor.MulticastProcessor in project camel by apache.
the class RouteBuilderTest method testWireTap.
public void testWireTap() throws Exception {
List<Route> routes = buildWireTap();
log.debug("Created routes: " + routes);
assertEquals("Number routes created", 1, routes.size());
for (Route route : routes) {
Endpoint key = route.getEndpoint();
assertEquals("From endpoint", "direct://a", key.getEndpointUri());
EventDrivenConsumerRoute consumer = assertIsInstanceOf(EventDrivenConsumerRoute.class, route);
Channel channel = unwrapChannel(consumer.getProcessor());
MulticastProcessor multicastProcessor = assertIsInstanceOf(MulticastProcessor.class, channel.getNextProcessor());
List<Processor> endpoints = new ArrayList<Processor>(multicastProcessor.getProcessors());
assertEquals("Should have 2 endpoints", 2, endpoints.size());
assertSendToProcessor(unwrapChannel(endpoints.get(0)).getNextProcessor(), "direct://tap");
assertSendToProcessor(unwrapChannel(endpoints.get(1)).getNextProcessor(), "direct://b");
}
}
Aggregations