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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top