JiriOndrusek commented on code in PR #4568: URL: https://github.com/apache/camel-quarkus/pull/4568#discussion_r1106743814
########## test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CallbackUtil.java: ########## @@ -46,15 +46,22 @@ static Optional<TestInstance.Lifecycle> getLifecycle(CamelQuarkusTestSupport tes return Optional.empty(); } - static void resetContext(CamelQuarkusTestSupport testInstance) { + static void resetContext(CamelQuarkusTestSupport testInstance, boolean keepOriginalRoutes) { - //if routeBuilder (from the test) was used, all routes has to be stopped and removed + //if routeBuilder (from the test) was used, all routes from that builder has to be stopped and removed //because routes will be created again (in case of TestInstance.Lifecycle.PER_CLASS, this method is not executed) - if (testInstance.isUseRouteBuilder()) { - try { - testInstance.context().getRouteController().stopAllRoutes(); - testInstance.context().getRouteController().removeAllRoutes(); + if (testInstance.isUseRouteBuilder() && testInstance.createdRoutes != null) { + try { + if (keepOriginalRoutes) { Review Comment: I'll add comment here. that makes sense, it didn't occur to me that it is my own definition of routes. -- 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