Returning the proper stub from mountebank for two almost identical stubs

14 Views Asked by At

Say I have two stubs, stubA and stubB for two POST requests. The only difference between them is one field in the body section, in the below example, it would the the productCode that is different, say LG265 instead of LG555.

When I send the request, I get the response of whichever stub is listed first in my imposters.ejs file. My question is, how to I get the response I want depending on my request input?

"predicates": [
    {
      "startsWith": {
        "method": "POST",
        "path": "/getCarInfo"
      },
      "equals": {
        "body": {
          "dealerId": "731736",
          "products": [
            {
              "productCode": "LG555",
              "quantity": 1
            }
          ],
          "countryCode": "CA"
        }
      }
    }
  ], ```
0

There are 0 best solutions below