【发布时间】:2018-01-20 23:37:36
【问题描述】:
我的项目有一个 Anypoint MQ 连接器 - 我想通过 munit 测试来模拟它,有人可以建议如何模拟它
【问题讨论】:
标签: mocking mule anypoint-studio munit
我的项目有一个 Anypoint MQ 连接器 - 我想通过 munit 测试来模拟它,有人可以建议如何模拟它
【问题讨论】:
标签: mocking mule anypoint-studio munit
试试这个方法 -
<mock:when messageProcessor=".*:.*" doc:name="Mock_Anypoint_MQ">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="#['abc']"/>
</mock:with-attributes>
<mock:then-return payload="#['Message Published!']"/>
</mock:when>
如果您遇到任何问题,请再次发布。
【讨论】:
我已经这样做了,如下所示
<mock:when messageProcessor="anypoint-mq:publish" doc:name="Mock Anypoint MQ">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="#['Anypoint MQ']"/>
</mock:with-attributes>
<mock:then-return payload="#['Message publised successfully.']"/>
</mock:when>
【讨论】: