public class PrintingResultHandler extends Object implements ResultHandler
MvcResult details to a given output
stream — for example: System.out, System.err, a
custom java.io.PrintWriter, etc.
An instance of this class is typically accessed via one of the
print or log
methods in MockMvcResultHandlers.
| 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 org.springframework.util.MultiValueMap<String,String> |
getParamsMultiValueMap(MockHttpServletRequest request) |
protected PrintingResultHandler.ResultValuePrinter |
getPrinter() |
protected org.springframework.http.HttpHeaders |
getRequestHeaders(MockHttpServletRequest request) |
protected org.springframework.http.HttpHeaders |
getResponseHeaders(MockHttpServletResponse response) |
void |
handle(MvcResult result)
Print
MvcResult details. |
protected void |
printAsyncResult(MvcResult result) |
protected void |
printFlashMap(org.springframework.web.servlet.FlashMap flashMap)
Print "output" flash attributes.
|
protected void |
printHandler(Object handler,
org.springframework.web.servlet.HandlerInterceptor[] interceptors)
Print the handler.
|
protected void |
printModelAndView(org.springframework.web.servlet.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.handle in interface ResultHandlerresult - the result of the executed requestException - if a failure occursprotected void printRequest(MockHttpServletRequest request) throws Exception
Exceptionprotected final org.springframework.http.HttpHeaders getRequestHeaders(MockHttpServletRequest request)
protected final org.springframework.util.MultiValueMap<String,String> getParamsMultiValueMap(MockHttpServletRequest request)
protected void printAsyncResult(MvcResult result) throws Exception
Exceptionprotected void printHandler(Object handler, org.springframework.web.servlet.HandlerInterceptor[] interceptors) throws Exception
Exceptionprotected void printResolvedException(Exception resolvedException) throws Exception
Exceptionprotected void printModelAndView(org.springframework.web.servlet.ModelAndView mav)
throws Exception
Exceptionprotected void printFlashMap(org.springframework.web.servlet.FlashMap flashMap)
throws Exception
Exceptionprotected void printResponse(MockHttpServletResponse response) throws Exception
Exceptionprotected final org.springframework.http.HttpHeaders getResponseHeaders(MockHttpServletResponse response)