This message was deleted.
# general
s
This message was deleted.
a
You can use
priority
to force WireMock to check more specific mappings before more generic mappings. One moment, getting an example.
Copy code
{
  "mappings": [
    {
      "priority": 1,
      "request": {
        "url": "xyz",
        "method": "POST",
        "bodyPatterns": [
          {
            "matchesXPath": {
              "expression": "abc/id/text()",
              "equalTo": "12345"
            }
          }
        ]
      },
      "response": {
        "bodyFileName": "xyz/Success_default-rsp.txt"
      }
    },
    {
      "priority": 5,
      "request": {
        "url": "xyz",
        "method": "POST"
      },
      "response": {
        "bodyFileName": "xyz/some_other_response.txt"
      }
    }
  ]
}
The higher the priority (lower number), the earlier that WireMock checks for a match. So any requests to
xyz
with that
abc/id === 12345
will match on the Priority 1, and any other requests to
xyz
will match on the Priority 5.
I think by default all mappings are Priority 10?