...
The Camel Test kit will by default setup and shutdown CamelContext per every test method in your test class. So for example if you have 3 test methods, then CamelContext is started and shutdown after each test, that is 3 times.
Tip | ||
---|---|---|
| ||
This feature is also supported in camel-testng |
You may want to do this once, to share the CamelContext between test methods, to speedup unit testing. This requires to use JUnit 4! In your unit test method you have to extend the org.apache.camel.test.junit4.CamelTestSupport
or the org.apache.camel.test.junit4.CamelSpringTestSupport
test class and override the isCreateCamelContextPerClass
method and return true
as shown in the following example:
...