public class PrintingResultHandler extends Object implements ResultHandler
MvcResult
details to the "standard" output
stream. An instance of this class is typically accessed via
MockMvcResultHandlers.print()
.Modifier and Type | Class and Description |
---|---|
protected static interface |
PrintingResultHandler.ResultValuePrinter
A contract for how to actually write result information.
|
Modifier | Constructor and Description |
---|---|
protected |
PrintingResultHandler(PrintingResultHandler.ResultValuePrinter printer)
Protected constructor.
|
Modifier and Type | Method and Description |
---|---|
protected MultiValueMap<String,String> |
getParamsMultiValueMap(MockHttpServletRequest request) |
protected PrintingResultHandler.ResultValuePrinter |
getPrinter() |
protected HttpHeaders |
getRequestHeaders(MockHttpServletRequest request) |
protected HttpHeaders |
getResponseHeaders(MockHttpServletResponse response) |
void |
handle(MvcResult result)
Print
MvcResult details to the "standard" output stream. |
protected void |
printAsyncResult(MvcResult result) |
protected void |
printFlashMap(FlashMap flashMap)
Print "output" flash attributes
|
protected void |
printHandler(Object handler,
HandlerInterceptor[] interceptors)
Print the handler
|
protected void |
printModelAndView(ModelAndView mav)
Print the ModelAndView
|
protected void |
printRequest(MockHttpServletRequest request)
Print the request
|
protected void |
printResolvedException(Exception resolvedException)
Print exceptions resolved through a HandlerExceptionResolver
|
protected void |
printResponse(MockHttpServletResponse response)
Print the response
|
protected PrintingResultHandler(PrintingResultHandler.ResultValuePrinter printer)
printer
- a PrintingResultHandler.ResultValuePrinter
to do the actual writingprotected PrintingResultHandler.ResultValuePrinter getPrinter()
public final void handle(MvcResult result) throws Exception
MvcResult
details to the "standard" output stream.handle
in interface ResultHandler
result
- the result of the executed requestException
- if a failure occursprotected void printRequest(MockHttpServletRequest request) throws Exception
Exception
protected final HttpHeaders getRequestHeaders(MockHttpServletRequest request)
protected final MultiValueMap<String,String> getParamsMultiValueMap(MockHttpServletRequest request)
protected void printAsyncResult(MvcResult result) throws Exception
Exception
protected void printHandler(Object handler, HandlerInterceptor[] interceptors) throws Exception
Exception
protected void printResolvedException(Exception resolvedException) throws Exception
Exception
protected void printModelAndView(ModelAndView mav) throws Exception
Exception
protected void printFlashMap(FlashMap flashMap) throws Exception
Exception
protected void printResponse(MockHttpServletResponse response) throws Exception
Exception
protected final HttpHeaders getResponseHeaders(MockHttpServletResponse response)