Reputation: 127
Is it possible to create a "fail fast" unit test for apache camel?
I'm using MockEndpoint in camel unit tests, provide some expectations like message count. And do a call to assertIsSatisfied.
This waits until success or timeout, so if an exchange fails, my test waits for timeout extending the duration. For most tests it's true that a failed exchange means the test will fail. It would be nice that it fails fast - after throwing the exception and not waiting for timeout.
Upvotes: 2
Views: 258
Reputation: 55525
No it would not be easy to do via the mock endpoint, however it can be a good improvement, to allow to setup a fail fast mode.
You are welcome to log a JIRA ticket at Apache Camel: http://issues.apache.org/jira/browse/CAMEL
You can use the NotifyBuilder
to setup that when any failed, and then have it trigger, but it won't blend-in well with assertIsSatisfied
on the mock endpoints.
Upvotes: 1