mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
a7503e7200
This commit makes asynchronous requests first class by providing a MvcTestResult that represents the final, completed, state of a request by default. Previously, the result was an intermediate step that may require an ASYNC dispatch to be fully usable. Now it is de facto immutable. To make things a bit more explicit, an `.exchange(Duration)` method has been added to provide a dedicated time to wait. The default applies a default timeout that is consistent with what MVcResult#getAsyncResult does. Given that we apply the ASYNC dispatch automatically, the intermediate response is no longer available by default. As a result, the asyncResult is not available for assertions. As always, it is possible to use plain MockMvc by using the `perform` method that takes the regular RequestBuilder as an input. When this method is invoked, no asynchronous handling is done. Closes gh-33040