1

I'm trying to write a MUNIT test case for mule service and want to ignore a field having timestamp. Currently, i'm using below code to perform the compare.

org.skyscreamer.jsonassert.JSONAssert.assertEquals(getResource('json/item-locations.json').asString(), payload, false);

I want to ignore field "creationDateTime" which is available in my json message.

Piyush Singh
  • 57
  • 1
  • 8

1 Answers1

1

Just delete the field from the message before comparing it. If you want to make sure it's actually there, then replace it with a constant value, but only if it exists.

Willis Blackburn
  • 8,068
  • 19
  • 36