camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From biphasic <>
Subject How to test routes when using another TestRunner
Date Thu, 15 Oct 2015 16:01:12 GMT
I have a few tests to check my Camel routes that when run using the
SpringJUnit4ClassRunner work just fine. However, I want to test some routes
of my application with Cucumber (basically something similar to JUnit). This
requires me to use another TestRunner (Cucumber.class). When trying to call
my tests from a Cucumber stack, the class that extends
CamelSpringTestSupport will not set any form of context. It just skips
createApplicationContext(). I am still able to access beans though.

What I now did as an ugly fix was to set the context manually.

this.context = new

I can now send something to endpoints, can access beans and whatnot. But the
assertion of expectedMessages at my MockEndpoint still always fails. 

Is there something else that I manually have to recreate when extending
CamelSpringTestSupport and I cannot use the SpringJUnitClassRunner?

Thankful for any hints,

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message