I'm using WireMock-Net for stubbing requests.
I want to do the following request:
Request:
http://localhost:63078/services/query/?q=SELECT Id from User where username='user@gmail.com'
The request is composed by a SOQL Query. Here's a snippet of what I tried to do:
stub.Given(Request.Create()
.WithPath("/services/query/")
.WithParam("q", "SELECT Id from User where username='user@gmail.com'")
.UsingGet())
.RespondWith(Response.Create()
.WithStatusCode(200)
.WithHeader("Content-Type", "application/json")
.WithBodyAsJson(new { Id = "5bdf076c-5654-4b3e-842c-7caf1fabf8c9" }));
The problem is: wiremock always replies with a 404. I've also tried using the RegexMatcher, like so:
.WithPath("/services/query/")
.WithParam("q", new WireMock.Matchers.RegexMatcher("SELECT Id from User where username.*$"))
But I still got a 404.
I think the problem is in the query parameter, because it has two equals "=". Can someone help me solve this?