接口的使用
org.springframework.test.web.servlet.ResultHandler
使用ResultHandler的程序包 程序包 说明 org.springframework.test.web.servlet Contains server-side support for testing Spring MVC applications.org.springframework.test.web.servlet.result Contains built-inResultMatcher
andResultHandler
implementations.org.springframework.test.web.servlet.setup Contains built-inMockMvcBuilder
implementations.org.springframework.test.web.servlet中ResultHandler的使用
参数类型为ResultHandler的org.springframework.test.web.servlet中的方法 修饰符和类型 方法 说明 ResultActions
ResultActions. andDo(ResultHandler handler)
Perform a general action.org.springframework.test.web.servlet.result中ResultHandler的使用
实现ResultHandler的org.springframework.test.web.servlet.result中的类 修饰符和类型 类 说明 class
PrintingResultHandler
Result handler that printsMvcResult
details to a given output stream — for example:System.out
,System.err
, a customjava.io.PrintWriter
, etc.返回ResultHandler的org.springframework.test.web.servlet.result中的方法 修饰符和类型 方法 说明 static ResultHandler
MockMvcResultHandlers. log()
LogMvcResult
details as aDEBUG
log message via Apache Commons Logging using the log categoryorg.springframework.test.web.servlet.result
.static ResultHandler
MockMvcResultHandlers. print()
PrintMvcResult
details to the "standard" output stream.static ResultHandler
MockMvcResultHandlers. print(OutputStream stream)
PrintMvcResult
details to the suppliedOutputStream
.static ResultHandler
MockMvcResultHandlers. print(Writer writer)
org.springframework.test.web.servlet.setup中ResultHandler的使用
参数类型为ResultHandler的org.springframework.test.web.servlet.setup中的方法 修饰符和类型 方法 说明 <T extends B>
TAbstractMockMvcBuilder. alwaysDo(ResultHandler resultHandler)
<T extends B>
TConfigurableMockMvcBuilder. alwaysDo(ResultHandler resultHandler)
Define a global action that should always be applied to every response.