wiremock: 404 error for url with query param

1.9k views Asked by At

I have the below .json under mappings folder

{ "request":

{
  "urlPathPattern": "abc/search",
  "method": "GET",
  "queryParameters":{
    "abc":{
        "equalTo":"05064"
    },
    "type":{
        "equalTo":"detailed"
    },
    "updatedAfter":{
        "equalTo":"2017-08-20T05:00:00Z"
    },
    "updatedBefore":{
        "equalTo":"2017-08-23T22:18:54Z"
    }
  }
},

"response": {

  "status": 200,
  "headers":
    {
      "Content-Type" : "application/json"
    },
   "bodyFileName": "abc_1.json"
}

}

But whenever i hit the below endpoint

http://localhost:8080/abc/search?abc=05064&type=detailed&updatedAfter=2017-08-20T05:00:00Z&updatedBefore=2017-08-23T22:18:54Z

I am getting 404 error. Can someone point where I am going wrong?

1

There are 1 answers

0
Tom On BEST ANSWER

You need a leading slash in the urlPathPattern attribute value:

"urlPathPattern": "/abc/search",