简体   繁体   English

骆驼:忽略模拟端点中的某些消息

[英]Camel: Ignore some messages in mock endpoint

I have to unit test a component that sends 3 messages to a mock endpoint, but i only want to test the second message and ignore the others. 我必须对将3条消息发送到模拟端点的组件进行单元测试,但是我只想测试第二条消息,而忽略其他消息。 How can i do this? 我怎样才能做到这一点? i know, that there will be three messages. 我知道会有三则讯息。 i dont care about the first and the third one... 我不在乎第一个和第三个...

文档中所述,您可以使用mock.message(1)设置断言并对第二条收到的消息进行测试。

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

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