我面临难以在 munit 中设置 ParameterMap。当我在 munit 中设置 http.uri.params 并且它正常工作时。但无法通过 ParameterMap 访问其值。请参考以下 MUnit 代码(当我访问 #[message.inboundProperties.'http.uri.params'.serviceName] 时工作正常)和 Java 代码
<munit:inbound-property key="http.uri.params" value="#[['serviceName': 'services','loanNumber':'1111']]"/>
这就是我在我的代码中访问 http.uri.params 的方式
ParameterMap pMap = eventContext.getMessage().getInboundProperty("http.uri.params");
所以当我运行 munit 时,上面的行会抛出异常(java.util.HashMap 不能转换为 org.mule.module.http.internal.ParameterMap)
有什么方法可以在 munit 中设置参数映射而不更改我的代码?