essobedo commented on PR #7995: URL: https://github.com/apache/camel/pull/7995#issuecomment-1182953480
The test case doesn't really prove that the bug is fixed. Here is a good test case with normal route and route template: ``` class RouteConfigurationOnExceptionTest extends ContextTestSupport { @Override protected RouteBuilder[] createRouteBuilders() { return new RouteBuilder[] { new RouteBuilder() { @Override public void configure() { routeTemplate("route-template") .from("direct:start-template") .routeConfigurationId("my-error-handler") .throwException(RuntimeException.class, "Expected Error"); } }, new RouteBuilder() { @Override public void configure() { TemplatedRouteBuilder.builder(context, "route-template") .routeId("my-test-file-route") .add(); } }, new RouteBuilder() { @Override public void configure() { from("direct:start-normal") .routeConfigurationId("my-error-handler") .throwException(RuntimeException.class, "Expected Error"); } }, new RouteConfigurationBuilder() { @Override public void configuration() { routeConfiguration("my-error-handler").onException(Exception.class).handled(true) .transform(constant("Error Received")) .to("mock:result"); } } }; } @Test void testRouteTemplateCanSupportRouteConfiguration() throws Exception { getMockEndpoint("mock:result").expectedMessageCount(1); getMockEndpoint("mock:result").expectedBodiesReceived("Error Received"); template.sendBody("direct:start-template", "foo"); assertMockEndpointsSatisfied(); } @Test void testNormalRouteCanSupportRouteConfiguration() throws Exception { getMockEndpoint("mock:result").expectedMessageCount(1); getMockEndpoint("mock:result").expectedBodiesReceived("Error Received"); template.sendBody("direct:start-normal", "foo"); assertMockEndpointsSatisfied(); } } ``` You will see that the test with the route template fails and the other passes. After a quick investigation, the main additional problem seems to be the fact that the route is not prepared when registering it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org