-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Servlet error message in MockMvc assertions
Prior to this commit, `MockMvc` would support checking for the Servlet error message as the "response status reason". While this error message can be driven with the `@ResponseStatus` annotation, this message is not technically the HTTP status reason listed on the response status line. This message is provided by the Servlet container in the error page when the `response.sendError(int, String)` method is used. This commit adds the missing `mvc.get().uri("/error/message")).hasErrorMessage("error message")` assertion to check for this Servlet error message. Closes gh-34016
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters