Interface MvcResult
public interface MvcResult
Provides access to the result of an executed request.
- Since:
- 3.2
- Author:
- Rossen Stoyanchev
- 
Method SummaryModifier and TypeMethodDescriptionGet the result of async execution.getAsyncResult(long timeToWait) Get the result of async execution and wait if necessary.Return the "output" flash attributes saved during request processing.Return the executed handler.Return interceptors around the handler.Return theModelAndViewprepared by the handler.Return the performed request.Return any exception raised by a handler and successfully resolved through aHandlerExceptionResolver.Return the resulting response.
- 
Method Details- 
getRequestMockHttpServletRequest getRequest()Return the performed request.- Returns:
- the request, never null
 
- 
getResponseMockHttpServletResponse getResponse()Return the resulting response.- Returns:
- the response, never null
 
- 
getHandlerReturn the executed handler.- Returns:
- the handler, possibly nullif none were executed
 
- 
getInterceptorsReturn interceptors around the handler.- Returns:
- interceptors, or nullif none were selected
 
- 
getModelAndViewReturn theModelAndViewprepared by the handler.- Returns:
- a ModelAndView, ornullif none
 
- 
getResolvedExceptionReturn any exception raised by a handler and successfully resolved through aHandlerExceptionResolver.- Returns:
- an exception, or nullif none
 
- 
getFlashMapFlashMap getFlashMap()Return the "output" flash attributes saved during request processing.- Returns:
- the FlashMap, possibly empty
 
- 
getAsyncResultObject getAsyncResult()Get the result of async execution.This method will wait for the async result to be set within the timeout value associated with the async request, see MockAsyncContext#setTimeout. Alternatively, usegetAsyncResult(long)to specify the amount of time to wait.- Throws:
- IllegalStateException- if the async result was not set
 
- 
getAsyncResultGet the result of async execution and wait if necessary.- Parameters:
- timeToWait- how long to wait for the async result to be set, in milliseconds; if -1, then fall back on the timeout value associated with the async request, see- MockAsyncContext#setTimeoutfor more details.
- Throws:
- IllegalStateException- if the async result was not set
 
 
-