-
-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParamMatcher failed when using parameter with comma #849
Comments
What you can try: 1️⃣ 2️⃣ |
No. Nothing is wrong on your end I just realized that I need to release a new version which includes this. I'll do that now. |
Thanks, @StefH I've just downloaded the new release, and now the property is ok. When you said "url-escape the comma", could you show an example? I tried somethings, but I still got the error. |
It could be that Url escaping does indeed nor work. Then you need to use option 2. Can this issue be closed? |
I'm still facing the issue. The API I'm trying to mock is this one: It's a public Oracle REST API, to query entities from database. |
@gigiogodoi |
@StefH https://github.com/gigiogodoi/UnitTestWithWiremock Inside it, there are 2 test cases, one failing because it is using a query with comma. |
Thanks a lot for this unit test. I did find the issue and it's fixed in preview version |
@StefH query=select id, name, value from table where id in (1, 2, 3, 4, 5) |
@gigiogodoi Is it ok? |
I'll merge the PR. |
I was not able to download the preview version, because it was not releated in the nuget package manager. But I will try once you release a new version. |
previews are here: https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions But I'll release an official version today on nuget. |
Describe the bug
I'm working on a system that consumes a 3rd party API which accepts as querystring a SQL statement.
For example, to query some data from any table just build the URI like this:
http://host/api/queryservice?query=SELECT id FROM table WHERE id = 1
While trying to mock this API, I realized that whenever I tried to mock a statement using comma, the ParamMatcher fails.
For example,
SELECT id, value FROM table WHERE id = 1
.And I received a 404 (NotFound) error code.
Expected behavior:
I expected the ParamMatcher has succeded, and returned 200 (OK).
Test to reproduce
1 - Create an API which receives as querystring a SQL statement
2 - Mock that API using "WithParam" function
3 - Test creating a statement which has a 'comma' within, "SELECT id, value FROM table WHERE id = 1"
Other related info
Provide additional information if any.
The text was updated successfully, but these errors were encountered: