【发布时间】: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>
【问题讨论】: