【问题标题】:How to mock anypoint mq in mule munit如何在 mule munit 中模拟任何点 mq
【发布时间】:2018-01-20 23:37:36
【问题描述】:

我的项目有一个 Anypoint MQ 连接器 - 我想通过 munit 测试来模拟它,有人可以建议如何模拟它

【问题讨论】:

    标签: mocking mule anypoint-studio munit


    【解决方案1】:

    试试这个方法 -

     <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>
    

    如果您遇到任何问题,请再次发布。

    【讨论】:

      【解决方案2】:

      我已经这样做了,如下所示

       <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>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-07-06
        • 2020-10-26
        • 1970-01-01
        • 2015-12-06
        • 1970-01-01
        • 1970-01-01
        • 2016-08-30
        相关资源
        最近更新 更多