简体   繁体   English

如何在 junit 测试用例的骆驼路线中跳过/模拟wireTap?

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

I have to write junit test cases for camel routes by skipping the wireTap.我必须通过跳过wireTap来为骆驼路线编写junit测试用例。 Or is there possibility to mock the wireTap?还是有可能模拟窃听器? If yes then how?如果是,那怎么办?

Thanks, Sreekanth谢谢, 斯里坎特

If your are wireTapping to uri "direct:foo", you can (for instance) weave your Camel route with:如果您正在窃听 uri“direct:foo”,您可以(例如)用以下方式编织您的 Camel 路线:

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

More info at: https://camel.apache.org/manual/advice-with.html更多信息请访问: https://camel.apache.org/manual/advice-with.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM