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

MockMvc async does not re-use response instance on async dispatch [SPR-16067] #20616

Closed
spring-issuemaster opened this issue Oct 13, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Oct 13, 2017

Lukas Krecan opened SPR-16067 and commented

I have a MockMvc test for testing controller with deferred result. It works nice, unit the moment I add ShallowEtagFilter which assumes that the response from the async start request is kept for the following processing. MockMvc.perform always creates new MockHttpServletResponse which causes ShallowEtagFilter to fail. Please, see this demo project for details https://github.com/lukas-krecan-lt/async-demo


Affects: 4.3.11

Reference URL: https://github.com/lukas-krecan-lt/async-demo/blob/master/src/test/java/com/example/asyncdemo/AsyncControllerTest.java

Issue Links:

  • #20976 MockMvc error handling with CompletableFuture regression in 5.0.1+

Referenced from: commits cd63463

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 17, 2017

Rossen Stoyanchev commented

I imagine in most cases the response isn't modified until the async dispatch, which explains why no one ever raised this as an issue. That said re-using the response would be more aligned with how it works inside a Servlet container.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Oct 17, 2017

Rossen Stoyanchev commented

There is now a fix in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.