Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试为 mule 服务编写一个 MUNIT 测试用例,并希望忽略具有时间戳的字段。目前,我正在使用下面的代码来执行比较。
org.skyscreamer.jsonassert.JSONAssert.assertEquals(getResource('json/item-locations.json').asString(), payload, false);
我想忽略我的 json 消息中可用的字段“creationDateTime”。
只需在比较之前从消息中删除该字段。如果您想确保它确实存在,则将其替换为常量值,但前提是它存在。