mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Bug: IRequestBuilder.WithParam broken for key-only matching #117
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @benjamin-bader on GitHub (Jun 28, 2018).
Originally assigned to: @StefH on GitHub.
I just upgraded our wiremock-net from
1.0.2.3to1.0.4.2and noticed that a few tests that were working have broken. This request matcher no longer works:The test issues an HTTP request like
GET /api/incidents/search?q=frank@contoso.com. In1.0.2.3, this request was matched by the server, but not in1.0.4.2. If I change the builder such that I call.WithParam("q", "frank@contoso.com"), it works.This seems like a regression, given that the API hasn't changed as far as I can tell.
@StefH commented on GitHub (Jun 28, 2018):
This seems like a bug, I'll investigate.
@StefH commented on GitHub (Jun 28, 2018):
New code can be used like:
See also linked code or branch : https://github.com/WireMock-Net/WireMock.Net/tree/Fix_IRequestBuilder.WithParam
@benjamin-bader commented on GitHub (Jun 29, 2018):
Cool, thanks. Looks like the original usage will work in the next release - is that correct?
@StefH commented on GitHub (Jun 29, 2018):
Correct the C# code will be backwards compatible.
However the mapping JSON be changed and looks like:
(You can use a WildcardMatcher, RegExMatcher, ExactMatcher or whatever.)
@benjamin-bader commented on GitHub (Jun 29, 2018):
Awesome - thanks for the advice and for the quick fix!
@StefH commented on GitHub (Jun 30, 2018):
NuGet is created