pact-jvm
pact-jvm copied to clipboard
Java Instant is treated as Decimal during provider verfication
I have basically the same problem as #1754 but on the provider side. I have a consumer project that generated the following pact file
...
"response": {
"body": {
"id": "421b1b7a-d651-4821-89a6-5dc588cf3cc5",
"state": "QUEUED",
"submitted": "2024-03-14T12:11:14Z"
},
"headers": {
"Content-Type": "application/json"
},
"status": 201
}
...
Verifying the provider gives me the following error:
1.1) body: $.submitted Expected 1710418274.000000000 (Decimal) to be equal to '2024-03-14T12:11:14Z' (String)
The expected value is the unix epoch representation of that Instant, but why does pact expect that? I manually called the API and it actually returns the value as string.
Can you provide the debug logs from your test and the actual request from the provider?
Sorry for the late answer, since I tried using pact at work we implemented the feature without pact and moved on to other things, so it might take a while, but I will try to provide more details after the Easter holiday