JiriOndrusek commented on issue #4362:
URL: https://github.com/apache/camel-quarkus/issues/4362#issuecomment-1373382460

   I got an idea what could be wrong. Is this scenario similar to yours?
   
   - There are 2 RouteBuilders in the main code `src/main/java` - creating 2 
routes
   - 1 RouteBuilder in the test  ('src/test/java')- creating 1 route
   -  Expected result is **1 route started** in the test execution
   - > In reality **3 routes are started** in the test execution
   
   I think that this is the expected behavior with the quarkus.
   
   Let me explain. 
   
   1. When execution a test.  Quarkus scans the whole code base (in this case 
src/main and src/test) and discovers 2 RouteBuilders.
   2. Camel-quarkus is started and both RouteBuilders are used to create 
routes, which are automatically started.
   During a beforeEachCalback (or similar one), the routeBuilder in the test is 
discovered and used -> there are currently 3 running routes. (I recently 
proposed a change which adds a warning, when this happens - 
https://github.com/apache/camel-quarkus/issues/4381)
   3. The test sees all 3 routes.
   
   I'd like to ask @ppalaga about his opinion.
   
   I think that as tests are testing application, some routes created by the 
application should stay running. (and are covered by the tests)
   I can imagine that test should stop the routes if need be.
   
   On the other hand having some kind of helper (or configurable behavior) 
which will ease the app's routes handling might help.
   
   What do you think @ppalaga?
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to