Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support custom status code in ExchangeResult for WebTestClient
Prior to this commit, ExchangeResult.assertWithDiagnostics() threw an IllegalArgumentException for a custom HTTP status code since toString() invoked getStatus() without a try-catch block. This commit addresses this issue by introducing a formatStatus() method that defensively formats the response status, initially trying to format the HttpStatus and falling back to formatting the raw integer status code. Closes gh-29283
- Loading branch information
Showing
2 changed files
with
29 additions
and
5 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