You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "aldettinger (via GitHub)" <gi...@apache.org> on 2023/02/14 18:25:42 UTC

[GitHub] [camel-quarkus] aldettinger commented on a diff in pull request #4568: Multiple test methods do not work when extending CamelQuarkusTestSupport

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


##########
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:
   Could you please details what `keepOriginal` means in this context ?
   
   It's like we keep the state of route ? Or we want a fresh route ?



-- 
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-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org