-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Feature request: assign application/json content type for FakeRequest #7878
Comments
Sounds like something worth investigating. Since this is for testing, we would still need to be able to send the body without the |
Hi @richdougherty, For these purposes users can use
Testing with no content type headers is much more rare scenario than testing controllers at all. |
I'm open to the idea. Would you like to sketch out the API changes? One thing to consider is that existing methods should continue to behave the same way—existing tests should preserve their behaviour. Another thing to think about is how this looks in equivalent the Java API. |
Yes, I will try to make initial drop in few days. And I think we can than move this discussion closer to code - PR. |
Hey @Abrasha, @richdougherty |
Picking this up |
I have made an initial drop for this. The only thing we can brake are tests that are checking for |
Are you looking for help?
No
Play Version
2.6.5
API
Scala
Operating System
MacOS:
JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)
Library Dependencies
Feature request
I would like (even expect) that
application/json
content type is automatically assigned toFakeRequest
whenwithJsonBody
method is called.I understand that there are some test cases when user tests unsupported content type but it is far rare cases. Do you agree?
This feature implementation can brake some of existing test cases described above.
Expected Behavior
application/json
content type is automatically assigned for FakeRequestActual Behavior
Reproducible Test Case
The text was updated successfully, but these errors were encountered: