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

Docs for Spring MVC Test should cover async requests [SPR-15099] #19666

Closed
spring-projects-issues opened this issue Jan 5, 2017 · 3 comments
Closed
Assignees
Labels
in: test Issues in the test module type: documentation A documentation task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

John Mark opened SPR-15099 and commented

MockMvc does not support async dispatches (as documented here). What actually happens is that the test can act in a non-deterministic fashion - failing intermittently, but passing sometimes - depending on how quick the async dispatch happens. It would be nice if MockMvc would fail-fast if async dispatch is used. This would reduce time spent investigating intermittently failing unit tests.


No further details from SPR-15099

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Depending on what you mean by async dispatches not being supported, this is perhaps just an issue with the documentation.

MockMvc does in fact support async dispatches via the asyncDispatch(MvcResult) method. Take a look at AsyncControllerJavaConfigTests for a concrete example.

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

You can find further examples for async dispatch in the Spring MVC Showcase tests.

@spring-projects-issues
Copy link
Collaborator Author

John Mark commented

I had not seen those examples. Perhaps the official Spring reference documentation should include some information about this.

I still think that it would be good for it to fail fast when asyncDispatch(MvcResult) is not used instead of acting in a non deterministic manner.

@spring-projects-issues spring-projects-issues added status: waiting-for-triage An issue we've not yet triaged or decided on in: test Issues in the test module type: enhancement A general enhancement and removed type: enhancement A general enhancement labels Jan 11, 2019
@rstoyanchev rstoyanchev self-assigned this Jul 4, 2019
@rstoyanchev rstoyanchev added type: documentation A documentation task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jul 4, 2019
@rstoyanchev rstoyanchev added this to the 5.1.9 milestone Jul 4, 2019
@rstoyanchev rstoyanchev changed the title MockMvc should error when unsupported web features are used [SPR-15099] Docs for Spring MVC Test should cover async requests [SPR-15099] Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

2 participants