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

Is it possible to test for the absence of a header or a query param? #889

Closed
bric3 opened this issue Dec 9, 2019 · 3 comments
Closed

Is it possible to test for the absence of a header or a query param? #889

bric3 opened this issue Dec 9, 2019 · 3 comments

Comments

@bric3
Copy link

bric3 commented Dec 9, 2019

I would like to verify that the http client does not send a specific headers. And the same for query params.

E.g. I need to harness the code for future generation to make sure some headers and query param are not the request.

I've tried things like .header("Accept-Encoding", newRegexMatcher("^$")) without big hopes, and indeed it fails.

@tommysitu
Copy link
Member

Are you talking about the verification feature in hoverfly-java? https://docs.hoverfly.io/projects/hoverfly-java/en/latest/pages/corefunctionality/verification.html

@bric3
Copy link
Author

bric3 commented Dec 13, 2019

Actually I hoped to craft my stub so that they could only reply if a header wasn't present.
But I could modify them with verification api indeed. Thanks for the tip.

@tommysitu
Copy link
Member

I think doing verification makes more sense for your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants