@FunctionalInterfaceSE public interface ResultHandler
ResultHandler は、実行されたリクエストの結果に対して一般的なアクションを実行します。たとえば、デバッグ情報を出力します。MockMvcResultHandlers の静的ファクトリメソッドを参照してください。
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*;
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*;
// ...
WebApplicationContext wac = ...;
MockMvc mockMvc = webAppContextSetup(wac).build();
mockMvc.perform(get("/form")).andDo(print());
| 修飾子と型 | メソッドと説明 |
|---|---|
void | handle(MvcResult result) 指定された結果に対してアクションを実行します。 |
void handle(MvcResult result) throws ExceptionSE
result - 実行されたリクエストの結果 ExceptionSE - 障害が発生した場合