spring-framework / org.springframework.test.web.servlet.result / RequestResultMatchers / asyncStarted

asyncStarted

open fun asyncStarted(): ResultMatcher

Assert whether asynchronous processing started, usually as a result of a controller method returning Callable or DeferredResult.

The test will await the completion of a Callable so that #asyncResult(Matcher) can be used to assert the resulting value. Neither a Callable nor a DeferredResult will complete processing all the way since a MockHttpServletRequest does not perform asynchronous dispatches.