Skip to content
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

Add convenient method for matching absence of query param in a request #2192

Conversation

G-Basak
Copy link
Contributor

@G-Basak G-Basak commented May 27, 2023

This pull request adds a convenient method for matching absence of query param in a request.
Usage example :

//after this pull request
verify(
    getRequestedFor(urlPathEqualTo("without/queryParam"))
        .withoutQueryParam("test-param"));

It was possible to verify the same even without this method as shown below, but felt counter-intuitive (given there is already a withoutHeader method).

//before this pull request
verify(
    getRequestedFor(urlPathEqualTo("without/queryParam"))
        .withQueryParam("test-param", absent()));

References

Submitter checklist

  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

@G-Basak G-Basak marked this pull request as ready for review May 27, 2023 13:34
@G-Basak G-Basak force-pushed the add-convenient-method-for-matching-absence-of-query-param-in-a-request branch from 9855f00 to 0701d4f Compare May 28, 2023 10:38
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, because indeed there are without methods and it's just some syntax sugar. Tagging @tomakehurst to get his opinion so that we're aligned on the vision for API sugar

@oleg-nenashev
Copy link
Member

We discussed thing and agreed it is good time to add some good DevX. Will proceed with merges, and thanks!

@oleg-nenashev oleg-nenashev merged commit 4a2593e into wiremock:master Jul 12, 2023
@G-Basak G-Basak deleted the add-convenient-method-for-matching-absence-of-query-param-in-a-request branch July 17, 2023 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants