I am using wiremock to mock my requests. However, I am not able to mock the URLs for which query values have equality sign. For ex:
/my/relative/path?param1=updated>-10d AND projectId=10001
As you can see the param1 value i.e updated>-10d AND projectId=10001 contains = sign within the value. And I have to mock the responses based on the projectId. So if I do something like this:
MockServer
.Given('/my/relative/path')
.WithParam("param1", new RegexMatcher("*10001*"))
.RespondWith(Response
.Create()
.WithStatusCode(200)
.WithHeader("content-type", "application/json;charset=UTF-8")
.WithBody("some body value"));
it doesn't work in this case. I have tried multiple combinations and I have observed that if the query value doesn't have = sign, then it works perfectly. But, how do I match it with my constraints i.e with the query value having = sign? Am I missing something really basic here? Any help would be highly appreciated.
/my/relative/path?param1=123¶m2=321?/my/relative/path?sql=condition1 AND condition 2 OR condition3. Here any of the condition could be of the form of something likeid >= 2orid = 2etc..