You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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
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
The text was updated successfully, but these errors were encountered: