接口 ResultHandler
- 所有已知实现类:
MockMvcResultHandlers.LoggingResultHandler,MockMvcResultHandlers.PrintWriterPrintingResultHandler,PrintingResultHandler
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
A
ResultHandler performs a generic action on the result of an
executed request — for example, printing debug information.
See static factory methods in
MockMvcResultHandlers.
Example
import static cn.taketoday.test.web.servlet.request.MockMvcRequestBuilders.*;
import static cn.taketoday.test.web.servlet.result.MockMvcResultHandlers.*;
import static cn.taketoday.test.web.servlet.setup.MockMvcBuilders.*;
// ...
WebApplicationContext wac = ...;
MockMvc mockMvc = webAppContextSetup(wac).build();
mockMvc.perform(get("/form")).andDo(print());
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Sam Brannen
-
方法概要
-
方法详细资料
-
handle
Perform an action on the given result.- 参数:
result- the result of the executed request- 抛出:
Exception- if a failure occurs
-