【问题标题】:How to mock "MuleSoft Anypoint Exchange" Custom API Connector using "Mock When" in MUnit?如何在 MUnit 中使用“Mock When”模拟“MuleSoft Anypoint Exchange”自定义 API 连接器?
【发布时间】:2019-08-09 17:12:14
【问题描述】:

我正在为 Proc 层实现流程编写 Munit,该流程使用 Exchange API 连接器调用 sys 层 POST 端点(Sys-Layer RAML 在 Exchange 中发布以生成其连接器)。当我为 API 连接器添加“模拟时”时,它不会模拟连接器并尝试调用实际的 API 端点。

我通过提供 API 连接器的处理器和 doc:id 和 doc:name 尝试了“模拟时间”。

以下是我的 API 连接器 XML 代码

<ol-smart-sys-property:create-announcement-by-code doc:name="Create announcement by code" doc:id="88b6e101-5999-4b11-b2ed-aeaee9ae5bd4" code="#[vars.code]" config-ref="Ol_smart_sys_property_Config"/>

以下是Mock当XML代码

<munit-tools:mock-when doc:name="Mock when" doc:id="8421e6fc-564e-44ea-94fe-78edbd1a979d" processor="ol-smart-sys-property:create-announcement-by-code">
    <munit-tools:with-attributes >
        <munit-tools:with-attribute attributeName="doc:id" whereValue="88b6e101-5999-4b11-b2ed-aeaee9ae5bd4" />
    </munit-tools:with-attributes>
    <munit-tools:then-return ></munit-tools:then-return>
</munit-tools:mock-when>

【问题讨论】:

    标签: mule mule-esb munit


    【解决方案1】:

    删除模拟工作的with-attributes 部分是否有效?我相信当前运行时中存在一个错误,这使得基于 Raml 的连接器在指定属性时无法被 MUnit 模拟

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-05
      • 1970-01-01
      • 2015-09-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多