2014-07-24 68 views
0

我們有我們的自定義HTTP連接器,並且是指連接器如下如何嘲笑HTTP連接器在munit

<http:connector name="myConnector"> 
<!-- config --> 
</http:connector> 
<http:endpoint name="myEndpoint" ref="myConnector"> 
<!-- config --> 
</http:endpoint> 

<http:outbound-endpoint name="myOutbound" ref="myEndpoint"> 

當我嘲笑HTTP出站時未指定任何屬性,那麼它的嘲諷。但如果出站我使用的模擬,同時指定屬性,則拋出異常說

"cannot process event as myConnector has stopped working". 

回答

0

默認munit將停止連接器,如果你看到那個消息就意味着你不打正確的嘲笑端點。我會檢查屬性是否正確匹配。你可以發佈你的模擬配置和你的端點配置嗎?因此可以提供更好的答案。

你可以嘲笑端點同樣遭到任何消息處理器:

whenMessageProcessor("outbound-endpoint").ofNamespace("http").thenReturnSameEvent() 

作爲一個側面說明,如果你不希望在默認情況下停止該連接器可以從FunctionalMunitSuite覆蓋haveToMockMuleConnectors信息:

@Override 
    public boolean haveToMockMuleConnectors() { 
     return false; 
    } 

但是你不會打到嘲諷的端點。