Interface ResultHandler
- All Known Implementing Classes:
PrintingResultHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ResultHandler
AResultHandlerperforms a generic action on the result of an executed request — for example, printing debug information.See static factory methods in
MockMvcResultHandlers.Example
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());- Since:
- 3.2
- Author:
- Rossen Stoyanchev, Sam Brannen
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidhandle(MvcResult result)Perform an action on the given result.