I have created a camel-route with multiple anonymous innerclass for processors as below:
from("direct:testRoute")
.process(new Processor() {
public void process(Exchange exchange) {
exchange.setProperty("prop1","value1");
}
})
.to("direct:testRoute2")
.process(new Processor() {
public void process(Exchange exchange){
exchange.setProperty("prop2","value2");
}
});
I have created junit for this as below:
public class OrderReportingServiceTest extends CamelTestSupport {
@Test
public void testRoute() {
Exchange exchange = new DefaultExchange(context);
template.send("direct:testRoute", exchange);
}
The problem is when I check for the junit code coverage second processor in my direct:testRoute is not covered. It works fine for first processor though.