如何在 Mule MUnit java 测试属性 withValue 中使用正则表达式
How to use regular expression in Mule MUnit java test attribute withValue
我有 java
Munit
测试,我正在验证对 <file:outbound-endpoint>
的调用,如下所示:
verifyCallOfMessageProcessor("outbound-endpoint")
.ofNamespace("file")
.withAttributes(attribute("path").withValue("/data/local/"),
attribute("outputPattern").withValue("vendor_customer_*"))
.times(1)
;
此代码段应在 Mule
代码下方进行测试:
<file:outbound-endpoint path="${root.drive}"
outputPattern="vendor_customer_#[server.dateTime.format('YYYY_MM_dd_hh_mm_ss.sss')].csv" />
如何在attribute("outputPattern").withValue("vendor_customer_*"))
中使用regular expression
表示属性值startsWith
vendor_customer_
我正在使用 MUnit 3.5
和 Mule 3.4.2
属性值不支持 RegEx。
您需要准确输入值。请看看:
https://docs.mulesoft.com/mule-user-guide/v/3.7/the-mock-message-processor#matchers
作为旁注,请注意 MUnit 不支持测试 Mule 3.4。
HTH
我有 java
Munit
测试,我正在验证对 <file:outbound-endpoint>
的调用,如下所示:
verifyCallOfMessageProcessor("outbound-endpoint")
.ofNamespace("file")
.withAttributes(attribute("path").withValue("/data/local/"),
attribute("outputPattern").withValue("vendor_customer_*"))
.times(1)
;
此代码段应在 Mule
代码下方进行测试:
<file:outbound-endpoint path="${root.drive}"
outputPattern="vendor_customer_#[server.dateTime.format('YYYY_MM_dd_hh_mm_ss.sss')].csv" />
如何在attribute("outputPattern").withValue("vendor_customer_*"))
中使用regular expression
表示属性值startsWith
vendor_customer_
我正在使用 MUnit 3.5
和 Mule 3.4.2
属性值不支持 RegEx。 您需要准确输入值。请看看: https://docs.mulesoft.com/mule-user-guide/v/3.7/the-mock-message-processor#matchers
作为旁注,请注意 MUnit 不支持测试 Mule 3.4。
HTH