Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicReference<java.lang.Object> |
asyncResult |
private java.lang.Object |
handler |
private HandlerInterceptor[] |
interceptors |
private MockHttpServletRequest |
mockRequest |
private MockHttpServletResponse |
mockResponse |
private ModelAndView |
modelAndView |
private java.lang.Exception |
resolvedException |
private static java.lang.Object |
RESULT_NONE |
Constructor and Description |
---|
DefaultMvcResult(MockHttpServletRequest request,
MockHttpServletResponse response)
Create a new instance with the given request and response.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAsyncResult()
Get the result of async execution.
|
java.lang.Object |
getAsyncResult(long timeToWait)
Get the result of async execution.
|
FlashMap |
getFlashMap()
Return the "output" flash attributes saved during request processing.
|
java.lang.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.
|
java.lang.Exception |
getResolvedException()
Return any exception raised by a handler and successfully resolved
through a
HandlerExceptionResolver . |
MockHttpServletResponse |
getResponse()
Return the resulting response.
|
void |
setAsyncResult(java.lang.Object asyncResult) |
void |
setHandler(java.lang.Object handler) |
void |
setInterceptors(HandlerInterceptor... interceptors) |
void |
setModelAndView(ModelAndView mav) |
void |
setResolvedException(java.lang.Exception resolvedException) |
private static final java.lang.Object RESULT_NONE
private final MockHttpServletRequest mockRequest
private final MockHttpServletResponse mockResponse
private java.lang.Object handler
private HandlerInterceptor[] interceptors
private ModelAndView modelAndView
private java.lang.Exception resolvedException
private final java.util.concurrent.atomic.AtomicReference<java.lang.Object> asyncResult
public DefaultMvcResult(MockHttpServletRequest request, MockHttpServletResponse response)
public MockHttpServletRequest getRequest()
MvcResult
getRequest
in interface MvcResult
null
public MockHttpServletResponse getResponse()
MvcResult
getResponse
in interface MvcResult
null
public void setHandler(java.lang.Object handler)
public java.lang.Object getHandler()
MvcResult
getHandler
in interface MvcResult
null
if none were executedpublic void setInterceptors(HandlerInterceptor... interceptors)
public HandlerInterceptor[] getInterceptors()
MvcResult
getInterceptors
in interface MvcResult
null
if none were selectedpublic void setResolvedException(java.lang.Exception resolvedException)
public java.lang.Exception getResolvedException()
MvcResult
HandlerExceptionResolver
.getResolvedException
in interface MvcResult
null
public void setModelAndView(ModelAndView mav)
public ModelAndView getModelAndView()
MvcResult
ModelAndView
prepared by the handler.getModelAndView
in interface MvcResult
ModelAndView
, or null
public FlashMap getFlashMap()
MvcResult
getFlashMap
in interface MvcResult
FlashMap
, possibly emptypublic void setAsyncResult(java.lang.Object asyncResult)
public java.lang.Object getAsyncResult()
MvcResult
MockAsyncContext.getTimeout()
.getAsyncResult
in interface MvcResult
public java.lang.Object getAsyncResult(long timeToWait)
MvcResult
getAsyncResult
in interface MvcResult
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()
.