org.springframework.test.web.servlet

## Interface MvcResult

    public interface MvcResult

Provides access to the result of an executed request.

Since:
  3.2
Author:
  Rossen Stoyanchev

### Method Summary

Methods
`Object` `getAsyncResult()` Get the result of asynchronous execution or `null` if concurrent handling did not start.
`Object` `getAsyncResult(long timeout)` Get the result of asynchronous execution or `null` if concurrent handling did not start.
`FlashMap` `getFlashMap()` Return the "output" flash attributes saved during request processing.
`Object` `getHandler()` Return the executed handler.
`HandlerInterceptor[]` `getInterceptors()` Return interceptors around the handler.
`ModelAndView` `getModelAndView()` Return the `ModelAndView` prepared by the handler.
`MockHttpServletRequest` `getRequest()` Return the performed request.
`Exception` `getResolvedException()` Return any exception raised by a handler and successfully resolved through a `HandlerExceptionResolver`.
`MockHttpServletResponse` `getResponse()` Return the resulting response.

### Method Detail

#### getRequest

    MockHttpServletRequest getRequest()

Return the performed request.

Returns:
  the request, never `null`

#### getResponse

    MockHttpServletResponse getResponse()

Return the resulting response.

Returns:
  the response, never `null`

#### getHandler

    Object getHandler()

Return the executed handler.

Returns:
  the handler, possibly `null` if none were executed

#### getInterceptors

    HandlerInterceptor[] getInterceptors()

Return interceptors around the handler.

Returns:
  interceptors, or `null` if none were selected

#### getModelAndView

    ModelAndView getModelAndView()

Return the `ModelAndView` prepared by the handler.

Returns:
  a `ModelAndView`, or `null`

#### getResolvedException

    Exception getResolvedException()

Return any exception raised by a handler and successfully resolved through a `HandlerExceptionResolver`.

Returns:
  an exception, possibly `null`

#### getFlashMap

    FlashMap getFlashMap()

Return the "output" flash attributes saved during request processing.

Returns:
  the `FlashMap`, possibly empty

#### getAsyncResult

    Object getAsyncResult()

Get the result of asynchronous execution or `null` if concurrent handling did not start. This method will hold and await the completion of concurrent handling.

Throws:
  `IllegalStateException` - if concurrent handling does not complete within the allocated async timeout value.

#### getAsyncResult

    Object getAsyncResult(long timeout)

Get the result of asynchronous execution or `null` if concurrent handling did not start. This method will wait for up to the given timeout for the completion of concurrent handling.

Parameters:
  `timeout` - how long to wait for the async result to be set in milliseconds; if -1, the wait will be as long as the async timeout set on the Servlet request