在我的一个 munit 测试用例中,我正在尝试使用“设置消息”设置 uri parmas。键值对如下例所示:
产品代码 :('11','10')
当我尝试在组件中设置它时,我遇到了 MEL 表达式的问题。单引号的表达似乎不接受。
错误: org.mule.api.MessagingException:MEL 解析失败。表达式:#[['productcode' :'( ('11','10'))']] 是无效的表达式。(org.mule.munit.common.exception.MunitError)。
下面是我的 Munit 测试用例。
<munit:test name="gl-impl-test-suite-gl-getTransactionDataFromAgresso-Test" description="Test">
<mock:when messageProcessor=".*:.*" doc:name="mockGetReconciliationDataFromAgresso">
<mock:with-attributes>
<mock:with-attribute name="doc:name" whereValue="#['getReconciliationDataFromAgresso']"/>
</mock:with-attributes>
<mock:then-return payload="#[getResource('scaffolder/response/emp/getEmployeeDetails.xml').asString()]" mimeType="application/xml"/>
</mock:when>
<munit:set payload="#[]" doc:name="Set Message">
<munit:inbound-properties>
<munit:inbound-property key="http.query.parmas" value="#[['productcode' :'( ('11','10'))']]"/>
</munit:inbound-properties>
</munit:set>
<logger level="INFO" doc:name="Logger"/>
<flow-ref name="gl-getTransactionDataFromAgresso" doc:name="Flow-ref to gl-getTransactionDataFromAgresso"/>
</munit:test>
请让我知道如何设置包含单引号的 MEL 表达式。