JiriOndrusek commented on code in PR #3847: URL: https://github.com/apache/camel-quarkus/pull/3847#discussion_r922069440
########## docs/modules/ROOT/pages/user-guide/testing.adoc: ########## @@ -226,3 +226,27 @@ class MyTest { ---- More examples of WireMock usage can be found in the Camel Quarkus integration test source tree such as https://github.com/apache/camel-quarkus/tree/main/integration-tests/geocoder[Geocoder]. + +== `CamelTestSupport` style of testing + +If you used plain Camel before, you may know https://camel.apache.org/components/latest/others/test-junit5.html[CamelTestSupport] already. +Unfortunately the Camel variant won't work on Quarkus and so we prepared a replacement called `CamelQuarkusTestSupport`, which can be used in JVM mode. + +There are several limitations: + +* Test has to be annotated by `@QuarkusTest` and has to extend `CamelQuarkusTestSupport`. +* Quarkus runs tests in a custom classloader which JUnit is not aware of (see the https://quarkus.io/guides/getting-started-testing#applying-interceptors-to-tests[documentation]). If JUnit's callback (i.e. `org.junit.jupiter.api.extension.BeforeEachCallback`) is used, it may not work as expected. Use the quarkus callbacks instead (see the https://quarkus.io/guides/getting-started-testing#enrichment-via-quarkustestcallback[documentation]) or use annotations like `@org.junit.jupiter.api.BeforeEach`. +* Camel Quarkus lifecycle does not allow to start/stop Camel context. Context is started before execution of the first test and closed after the finish of the last one. Test has to be written with consideration with this limitation. If it is not possible to write a test with such limitation, `@TestProfile` has to be used. Test profile forces quarkus to restart its engine, therefore it creates a new Camel context (see the https://quarkus.io/guides/getting-started-testing#testing_different_profiles/[documentation] about this feature). Review Comment: fixed -- 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