-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: testIssues in the test moduleIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
Overview
MockMvc.applyDefaultResultActions(MvcResult) currently applies default ResultMatchers before default ResultHandlers. Consequently, if a ResultMatcher fails, no ResultHandler will be applied.
For example, in the following test, if alwaysExpect(content().string("Boom!")) results in an exception, alwaysDo(print(System.err)) will never be applied, and the user will never see the expected debug output to help diagnose the problem.
@Test
void test() throws Exception {
standaloneSetup(new SimpleController())
.alwaysDo(print(System.err))
.alwaysExpect(content().string("Boom!"))
.build()
.perform(get("/"));
}Deliverables
- Ensure that default
ResultHandlers are applied before defaultResultMatchers.
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug