I'm trying to return stubbed date in Wiremock.
The expected date is today in ISO format yyyy-MM-dd
.
I cannot make it work. Here's the error:
.pointInTime [equalToDateTime] now +0 seconds| 2022-04-13}
Here's my relevant part of the mapping:
{
"matchesJsonPath": {
"expression": "$.pointInTime",
"equalToDateTime": "now",
"actualFormat": "yyyy-MM-dd"
}
As far I can say, Wiremock has problems with dealing with dates only without time part.
EDIT I tried to use answers from post given by @Sambit without no luck.
{
"matchesJsonPath":{
"expression":"$.pointInTime",
"equalToDateTime":"{{now timezone='Europe/Warsaw'}}"
}
}
Here's the now...
part is tried as literal:
$.pointInTime [equalToDateTime] {{now timezone='Europe/Warsaw'}}> but was 2022-04-13