You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
There is no way to assert that a WireMockServer has been called at a URL excluding query parameters.
Given my WireMockServer has been called at https://localhost:8080/api/endpoint/?param1=1¶m2=2
I would like to be able to do the following assertion wireMockServer.Should().HaveReceivedACall().AtUrl("https://localhost:8080/api/endpoint/");
However, this will fail as the URL does not contain the query parameters.
Describe the solution you'd like
I propose that an optional System.UriPartial parameter is added to the WireMockAssertions.AtUrl method so I could assert like so wireMockServer.Should().HaveReceivedACall().AtUrl("https://localhost:8080/api/endpoint/", UriPartial.Path);
This param could then be used by the method to only check the specified part of the URL like so Uri.GetLeftPart(UriPartial.Path);
Describe alternatives you've considered
Alternatively a new WireMockAssertions.AtPath method could be created that checks the mock has been called at a URL excluding the query params.
Additional context
I would like to implement this change myself if it is accepted as a feature
The text was updated successfully, but these errors were encountered:
Maybe adding an overload which accepts a WildcardMatcher could also solve your issue?
Yes that would work! That would also allow for the query parameters to be validated, nice.
@StefH Just to confirm, are you happy for me to progress with the change to add an overload to the WireMockAssertions.AtUrl method that takes a WildcardMatcher object to validate the URL against?
Is your feature request related to a problem? Please describe.
There is no way to assert that a
WireMockServer
has been called at a URL excluding query parameters.Given my
WireMockServer
has been called athttps://localhost:8080/api/endpoint/?param1=1¶m2=2
I would like to be able to do the following assertion
wireMockServer.Should().HaveReceivedACall().AtUrl("https://localhost:8080/api/endpoint/");
However, this will fail as the URL does not contain the query parameters.
Describe the solution you'd like
I propose that an optional
System.UriPartial
parameter is added to theWireMockAssertions.AtUrl
method so I could assert like sowireMockServer.Should().HaveReceivedACall().AtUrl("https://localhost:8080/api/endpoint/", UriPartial.Path);
This param could then be used by the method to only check the specified part of the URL like so
Uri.GetLeftPart(UriPartial.Path);
Describe alternatives you've considered
Alternatively a new
WireMockAssertions.AtPath
method could be created that checks the mock has been called at a URL excluding the query params.Additional context
I would like to implement this change myself if it is accepted as a feature
The text was updated successfully, but these errors were encountered: