Apache camel 为什么ProducerTemplate';集成测试中未返回的方法发送体?

Apache camel 为什么ProducerTemplate';集成测试中未返回的方法发送体?,apache-camel,junit5,spring-boot-test,Apache Camel,Junit5,Spring Boot Test,我想在Spring Boot集成测试中测试一个Apache Camel路由,但是集成测试没有完成。不会再回来了 春季启动应用程序 @springboot应用程序 公共类测试应用程序{ 公共静态void main(字符串[]args){ run(TestApplication.class,args); } @豆子 公共端点routeBuilder routeBuilder(){ 返回新的EndpointRouteBuilder(){ @凌驾 public void configure()引发异常{

我想在Spring Boot集成测试中测试一个Apache Camel路由,但是集成测试没有完成。不会再回来了

春季启动应用程序

@springboot应用程序
公共类测试应用程序{
公共静态void main(字符串[]args){
run(TestApplication.class,args);
}
@豆子
公共端点routeBuilder routeBuilder(){
返回新的EndpointRouteBuilder(){
@凌驾
public void configure()引发异常{
从(direct(“in”).multicast()到(direct(“route”)、direct(“request”);
从(直接(“路由”).setHeader(“id”),常量(“1”)。到(直接(“聚合”);
从(直接(“响应”).log(“响应:${body}”)到(直接(“聚合”);
来自(直接(“合计”))
.log(“在${body}中的聚合”)
.aggregate(标题(“id”)、AggregationStrategies.useLatest()
.completionSize(2)
.log(“聚合输出:${body}”)
。向(指示(“发出”);
}
};
}
}
春季开机集成测试

@SpringBootTest
@驼峰试验
@MockEndpointsAndSkip(“(直接:请求|直接:输出)”)
类TextRouteBuilderIT{
@端点注入(“模拟:直接:输出”)
私用终端外线;
@端点注入(“直接:响应”)
私有端点应答器;
@EndpointInject(“模拟:直接:请求”)
私有路由;
@自动连线专用产品模板;
@试验
void test()引发执行异常,InterruptedException{
requestRoute.whenAnyExchangeReceived(
新处理器(){
@凌驾
公共作废进程(Exchange)引发异常{
exchange.getIn().setBody(“响应”);
setHeader(“id”,“1”);
responseRoute.createProducer()进程(交换);
}
});
发送主体(“直接:在”、“测试”);
抛出新的RuntimeException();
}
}
日志

o.a.c.t.s.j.CamelAnnotationsHandler      : Enabling auto mocking and skipping of endpoints matching pattern [(direct:request|direct:out)] on CamelContext with name [camelContext].
c.t.s.j.CamelSpringBootExecutionListener : CamelSpringBootExecutionListener before: class test.TextRouteBuilderIT.test
c.t.s.j.CamelSpringBootExecutionListener : Initialized CamelSpringBootExecutionListener now ready to start CamelContext
o.a.c.t.s.j.CamelAnnotationsHandler      : Starting CamelContext with name [camelContext].
.i.e.InterceptSendToMockEndpointStrategy : Adviced endpoint [direct://request] with mock endpoint [mock:direct:request]
.i.e.InterceptSendToMockEndpointStrategy : Adviced endpoint [direct://out] with mock endpoint [mock:direct:out]
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.5.0 (camel-1) is starting
o.a.c.impl.engine.AbstractCamelContext   : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
o.a.c.impl.engine.AbstractCamelContext   : Using HealthCheck: camel-spring-boot
o.a.c.p.aggregate.AggregateProcessor     : Defaulting to MemoryAggregationRepository
o.a.c.i.e.InternalRouteStartupManager    : Route: route1 started and consuming from: direct://in
o.a.c.i.e.InternalRouteStartupManager    : Route: route2 started and consuming from: direct://route
o.a.c.i.e.InternalRouteStartupManager    : Route: route3 started and consuming from: direct://response
o.a.c.i.e.InternalRouteStartupManager    : Route: route4 started and consuming from: direct://aggregate
o.a.c.impl.engine.AbstractCamelContext   : Total 4 routes, of which 4 are started
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.5.0 (camel-1) started in 0.015 seconds
route4                                   : Aggregation-In: test
route3                                   : Response: Response
route4                                   : Aggregation-In: Response
route4                                   : Aggregation-out: Response
看起来最后一条路线已经完成,但Spring Boot集成测试仍在运行。不会引发运行时异常

研究

我跟着

我做错了什么