2014-10-17 36 views
1

我想寫一個mule munit測試(在java中),我想檢查消息是否通過特定的出站端點傳遞(或在這種情況下退出)因爲流中有路由,並且消息可以根據條件通過不同的路由?如何檢查端點是否用於munit測試

我的設置是實際使用2個不同的流文件,一個與使用普通終端如

<outbound-endpoint ref="out.endpoint" /> 

然後用實際的端點定義如

<vm:endpoint name="out.endpoint" path="out.path" /> 
另一個流文件的流邏輯

下面的Java代碼工作

verifyCallOfMessageProcessor("outbound-endpoint").times(1); 

不過我倒是升ike能夠指定端點的特定名稱。我已經嘗試過以下但沒有任何工作

verifyCallOfMessageProcessor("outbound-endpoint").withAttributes(attribute("name").withValue("out.endpoint")).times(1); 
verifyCallOfMessageProcessor("outbound-endpoint").withAttributes(attribute("ref").withValue("out.endpoint")).times(1); 
verifyCallOfMessageProcessor("endpoint").withAttributes(attribute("name").withValue("out.endpoint")).times(1); 
verifyCallOfMessageProcessor("endpoint").withAttributes(attribute("ref").withValue("out.endpoint")).times(1); 

所有這些4(哪些是會對我有意義的)失敗。有誰知道如何完成這個(最好通過Java,否則使用XML)?

回答

1

這應該是這樣:

verifyCallOfMessageProcessor("outbound-endpoint").ofNamespace("vm").withAttributes(attribute("name").ofNamespace("doc").withValue("out.endpoint")).times(1); 

檢查屬性名稱的命名空間「文檔。

相關問題