How to skip/mock the wireTap in camel route for junit test cases?

499 Views Asked by At

I have to write junit test cases for camel routes by skipping the wireTap. Or is there possibility to mock the wireTap? If yes then how ?

Thanks, Sreekanth

1

There are 1 best solutions below

0
TacheDeChoco On

If your are wireTapping to uri "direct:foo", you can (for instance) weave your Camel route with:

weaveByToUri("direct:foo").replace().to("mock:junit");

More info at: https://camel.apache.org/manual/advice-with.html