OK, that is quite calming. I almost began to review the error handling of all
Camel applications with subroutes. But the fact that it worked in the real
runtime environment was an indicator that it is "just" a test setup problem.
Perhaps it is another problem of the Spring-Boot test
I looked at the test again, and I’m pretty sure the issue has something to do
with the initialization logic. I re-wrote the same tests using
CamelTestSupport and they both pass (without the addition of the
NoErrorHandlerBuilder).
public class CamelRouteTest extends CamelTestSupport {
Thanks Quinn.
I knew that "global" onException clauses are only scoped to their RouteBuilder.
Follow-up question: Why are they not working for a subroute inside the same
RouteBuilder?
Context for other readers: In the following example, the onException clause
works fine for the
I’m not sure why this is working in the real world, but the reason the test is
failing is the default error handler is picking up the exception from the call
to the direct://Validate route. If you add
".errorHandler(new NoErrorHandlerBuilder())” to the direct://Validate
route, your test