The_Redhawk
The_Redhawk

Reputation: 273

Returning the proper stub from mountebank for two almost identical stubs

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"
        }
      }
    }
  ], ```

Upvotes: 0

Views: 154

Answers (0)

Related Questions