-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
Spring Boot currently registers an endpoint with the servlet container to process errors. This means that MockMvc cannot be used to assert the errors. For example, the following will fail:
mockMvc.perform(get("/missing"))
.andExpect(status().isNotFound())
.andExpect(content().string(containsString("Whitelabel Error Page")));with:
java.lang.AssertionError: Response content
Expected: a string containing "Whitelabel Error Page"
but: was ""
..
despite the fact that the message is displayed when the application is actually running. You can view this problem in https://github.com/rwinch/boot-mockmvc-error
It would be nice if Spring Boot could provide hooks to enable testing of the error pages too.
shakuzen, jhyot, saiimons, alimate, Librazy and 25 more
Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply