JiriOndrusek commented on code in PR #4568:
URL: https://github.com/apache/camel-quarkus/pull/4568#discussion_r1106762829


##########
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 removed this if. It should not be there. There is a following ticket, 
which I'm starting to work on, which takes care of the lifecycle with 
Lifecycle.PER_CLASS - https://github.com/apache/camel-quarkus/issues/4569



-- 
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

Reply via email to