Interface MvcResult
public interface MvcResult
Provides access to the result of an executed request.- Since:
- 3.2
- Author:
- Rossen Stoyanchev
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectgetAsyncResult()Get the result of async execution.ObjectgetAsyncResult(long timeToWait)Get the result of async execution.FlashMapgetFlashMap()Return the "output" flash attributes saved during request processing.ObjectgetHandler()Return the executed handler.HandlerInterceptor[]getInterceptors()Return interceptors around the handler.ModelAndViewgetModelAndView()Return theModelAndViewprepared by the handler.MockHttpServletRequestgetRequest()Return the performed request.ExceptiongetResolvedException()Return any exception raised by a handler and successfully resolved through aHandlerExceptionResolver.MockHttpServletResponsegetResponse()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
nullif none were executed
getInterceptors
HandlerInterceptor[] getInterceptors()
Return interceptors around the handler.- Returns:
- interceptors, or
nullif none were selected
getModelAndView
ModelAndView getModelAndView()
Return theModelAndViewprepared by the handler.- Returns:
- a
ModelAndView, ornull
getResolvedException
Exception getResolvedException()
Return any exception raised by a handler and successfully resolved through aHandlerExceptionResolver.- 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 async execution. This method will wait for the async result to be set for up to the amount of time configured on the async request, i.e.MockAsyncContext.getTimeout().- Throws:
IllegalStateException- if the async result was not set
getAsyncResult
Object getAsyncResult(long timeToWait)
Get the result of async execution. This method will wait for the async result to be set for up to the specified amount of time.- Parameters:
timeToWait- how long to wait for the async result to be set, in milliseconds; if -1, then the async request timeout value is used, i.e.MockAsyncContext.getTimeout().- Throws:
IllegalStateException- if the async result was not set