-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Added GET_OR_HEAD method. #2555
Conversation
@@ -75,7 +75,9 @@ public boolean equals(Object o) { | |||
if (o == null || getClass() != o.getClass()) return false; | |||
|
|||
RequestMethod that = (RequestMethod) o; | |||
|
|||
if (name.equals("GET_OR_HEAD") && (that.name.equals("GET") || that.name.equals("HEAD"))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure doing the equals behaviour this way is a good idea. If we ever needed to put this e.g. as a map key I suspect this would prevent that from working properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomakehurst Thanks for the feedback. Requested changes have been made.
|
||
assertThat(response.statusCode(), is(200)); | ||
assertThat(response.firstHeader("Content-Type"), is("application/json")); | ||
assertThat(response.content(), is(emptyOrNullString())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to see an assertion about Content-Length
matching the length of the response body.
I was wondering if it would be worth just getting |
I did wonder about this, but the |
Thanks! |
Closes #2414 . This PR adds a GET_OR_HEAD method. This stub method could be used for both get as well as head Http method. The response and http header information is returned accordingly
Submitter checklist
#help-contributing
or a project-specific channel like#wiremock-java