Roman Brühlmann
02/08/2023, 5:16 PMequalToJson
. In fact I've a date as property, which is created with LocalDateTime.now(). And clearly this date will never match. So here is my jsonRequestBody
String jsonRequestBody = String.format("{ \"document\": {\"documentData\": \"%s\"}, \"documentMetadata\": {\"documentId\": \"MYA-1234\", \"docType\": \"LEA\", \"docDataType\": \"PDF\", \"docName\": \"Some pdf\", \"insuredId\": 2000001, \"partnerId\": null, \"familyId\": 1000001, \"offerId\": null, \"contractId\": null, \"receiptId\": null, \"statementOfBenfitsId\": null, \"dasId\": null, \"zsrId\": null, \"enforcementId\": null, \"vipCode\": null, \"dossierId\": null, \"debitorId\": null, \"taskId\": null, \"tessiImageId\": null, \"invoiceId\": null, \"creationDate\": \"%s\", \"changeDate\": null, \"startDateRetentionPeriod\": null, \"insuranceType\": null, \"overdueReminderType\": null, \"receiptType\" : null, \"tessiType\" : null}}", document.getContent(), "${json-unit.ignore}");
As u can see, for the creationDate I'm trying to use a placeholder, like it's described here: https://wiremock.org/docs/request-matching/ But it doesn't work. Any idea why? Thank you in advanceAaron
02/08/2023, 5:18 PMjson-unit.any-string
?Roman Brühlmann
02/08/2023, 5:18 PMAaron
02/08/2023, 5:19 PMRoman Brühlmann
02/08/2023, 5:20 PMAaron
02/08/2023, 5:22 PMignoreExtraElements
flag to just check for those attributes. For example:
// actual request body
{
"foo": "bar",
"baz": "bar"
}
...
.withRequestBody(equalToJson("{ \"foo\": \"bar\" }", true, true))
...
Would match, even though I haven’t provided a match for "baz"
Roman Brühlmann
02/08/2023, 5:26 PM