Closed bulkan closed 6 years ago
{
"method" : "GET",
"path" : "/app/web-api/projects/1879048400/users",
"queryStringParameters" : {
"query" : [ ".*" ]
}
}
matches a request with a query string containing a parameter called query
, for example, one of the following:
/app/web-api/projects/1879048400/users?query=someRandomValue
/app/web-api/projects/1879048400/users?query=someRandomValue&someOtherQuery=someRandomValue
/app/web-api/projects/1879048400/users?query=
Is that what you expected?
Can you please provide details of the expectations you are creating and requests you sending then I can help you debug your issue.
I'm also facing a similar issue, using (version 5.3.0) I'm trying to Retrieve Active Expectations using following code -
HttpRequest request = new HttpRequest (); Expectation[] activeExpectations = new MockServerClient("localhost",1080).retrieveActiveExpectations(request);
But this doesn't return Expectations with "Query Parameters". Log has following message -
2018-01-04 18:39:31,930 INFO [nioEventLoopGroup-3-1] o.mockserver.mock.HttpStateHandler [?:?] retrieving active_expectations in json that match: { } 2018-01-04 18:39:31,935 INFO [nioEventLoopGroup-3-1] o.mockserver.mock.HttpStateHandler [?:?] request: { } did not match expectation: { "method" : "POST", "path" : "/Jassi", "queryStringParameters" : { "user" : [ "12345" ] } }
because:
method matches = true path matches = true query string parameters match = false body matches = true headers match = true cookies match = true keep-alive matches = true ssl matches = true
Since am not specifying any criteria, I'm expecting it to return all the Expectations, including the ones with QueryParameters.
I'll look into this
I have found the issue and I am resolving it.
It turns out the fix was more complex then I had hoped. It is now fixed in the current snapshot version. I will release a new version in the next few weeks once I have completed work on a UI.
Hi there,
I'm setting up 18 expectations and when I try to use
retrieveActiveExpectations
it returns only 17 of them with one missing.I've used this example and using
mockserver-client@5.2.3
Checking the mockserver logs I see the following;
The only difference I can see is that the other expectations don't set a
queryStringParameter
.I would have thought all recorded expectations are sent back ?