2024-04-15 18:00:07.876 ...
# wiremock-java
m
2024-04-15 180007.876 Request was not matched ======================= ----------------------------------------------------------------------------------------------------------------------- | Closest stub | Request | ----------------------------------------------------------------------------------------------------------------------- | POST | POST [regex] | /boarding/paymentmethod/PAYPAL/merchantBoarding /boarding/paymentmethod/([A-Z]{3,50})/merchantBoarding | | "$[?(@.name == 'test')] | ["{ \r\n \"name\": \"te <<<<< Body does not match | -----------------------------------------------------------------------------------------------------------------------
a
You have specified
matchesJsonPath
in your
bodyPatterns
element but the value does not seem valid.. according to the relevant documentation you need to specify a JSON Path expression such as:
Copy code
{
  "request": {
    ...
    "bodyPatterns" : [ {
      "matchesJsonPath": {
        "expression": "$.name",
        "equalTo": "test"
      }
    } ]
    ...
  },
  ...
}
I believe this might also do the trick:
Copy code
{
  "matchesJsonPath": "$.[?(@.name == 'test')]"
}