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.

Était-ce utile?

La 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top