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 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 to the "standard" output stream. |
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 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 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
Exception
protected void printHandler(Object handler, org.springframework.web.servlet.HandlerInterceptor[] interceptors) throws Exception
Exception
protected void printResolvedException(Exception resolvedException) throws Exception
Exception
protected void printModelAndView(org.springframework.web.servlet.ModelAndView mav) throws Exception
Exception
protected void printFlashMap(org.springframework.web.servlet.FlashMap flashMap) throws Exception
Exception
protected void printResponse(MockHttpServletResponse response) throws Exception
Exception
protected final org.springframework.http.HttpHeaders getResponseHeaders(MockHttpServletResponse response)