Question

Sorry, if I miss the forest for the trees...

We would like to junit-test some Java-DSL. We found some way to do this on our original routes and not with copied ones. Using i.e. expectedMessageCount() and assertIsSatisfied() works well for endpoints 'made with to()'.

Now I am searching for a way to intercept a processor (DSL process(new Processor() {...}) using intercept or better interceptSendToEndpoint, but that one has no URI. Is there a way to do this.

Was it helpful?

Solution

See the Camel testing documentation at

In the bottom there is links about testing existing routes, for example you can use advice with to intercept / replace parts of your routes before testing. For example if you assign an id to your processor, you can replace/remove the processor by the id, using advice with.

See the documentation and examples http://camel.apache.org/advicewith.html and you can look into the unit test source code of camel-core to find more examples.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top