我为处理器创建了带有多个匿名内部类的骆驼路线,如下所示:
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");
}
});
我为此创建了junit:
public class OrderReportingServiceTest extends CamelTestSupport {
@Test
public void testRoute() {
Exchange exchange = new DefaultExchange(context);
template.send("direct:testRoute", exchange);
}
问题是,当我在direct:testRoute中检查第二单元处理器的junit代码覆盖率时,未覆盖。不过,它对于第一个处理器也能正常工作。