Class PrintingResultHandler
java.lang.Object
org.springframework.test.web.servlet.result.PrintingResultHandler
- All Implemented Interfaces:
- ResultHandler
Result handler that prints 
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.
- Since:
- 3.2
- Author:
- Rossen Stoyanchev, Sam Brannen
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static interfaceA contract for how to actually write result information.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedProtected constructor.
- 
Method SummaryModifier and TypeMethodDescriptionprotected final MultiValueMap<String,String> protected PrintingResultHandler.ResultValuePrinterReturn the result value printer.protected final HttpHeadersgetRequestHeaders(MockHttpServletRequest request) protected final HttpHeadersgetResponseHeaders(MockHttpServletResponse response) final voidPrintMvcResultdetails.protected voidprintAsyncResult(MvcResult result) protected voidprintFlashMap(FlashMap flashMap) Print "output" flash attributes.protected voidprintHandler(Object handler, HandlerInterceptor[] interceptors) Print the handler.protected voidPrint the ModelAndView.protected voidprintRequest(MockHttpServletRequest request) Print the request.protected voidprintResolvedException(Exception resolvedException) Print exceptions resolved through a HandlerExceptionResolver.protected voidprintResponse(MockHttpServletResponse response) Print the response.
- 
Constructor Details- 
PrintingResultHandlerProtected constructor.- Parameters:
- printer- a- PrintingResultHandler.ResultValuePrinterto do the actual writing
 
 
- 
- 
Method Details- 
getPrinterReturn the result value printer.- Returns:
- the printer
 
- 
handlePrintMvcResultdetails.- Specified by:
- handlein interface- ResultHandler
- Parameters:
- result- the result of the executed request
- Throws:
- Exception- if a failure occurs
 
- 
printRequestPrint the request.- Throws:
- Exception
 
- 
getRequestHeaders
- 
getParamsMultiValueMap
- 
getSessionAttributes
- 
printAsyncResult- Throws:
- Exception
 
- 
printHandlerprotected void printHandler(@Nullable Object handler, @Nullable HandlerInterceptor[] interceptors) throws Exception Print the handler.- Throws:
- Exception
 
- 
printResolvedExceptionPrint exceptions resolved through a HandlerExceptionResolver.- Throws:
- Exception
 
- 
printModelAndViewPrint the ModelAndView.- Throws:
- Exception
 
- 
printFlashMapPrint "output" flash attributes.- Throws:
- Exception
 
- 
printResponsePrint the response.- Throws:
- Exception
 
- 
getResponseHeaders
 
-