From 74d3bceb19c4ab8319f4cd37b78542ea97c5b0e8 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Tue, 29 Dec 2015 21:23:09 +0100 Subject: [PATCH] Add missing StatusResultMatcher for HTTP Status 451 Issue: SPR-13632 --- .../test/web/servlet/result/StatusResultMatchers.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/result/StatusResultMatchers.java b/spring-test/src/main/java/org/springframework/test/web/servlet/result/StatusResultMatchers.java index 5efa9100ea..f2eba236db 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/result/StatusResultMatchers.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/result/StatusResultMatchers.java @@ -33,6 +33,7 @@ import static org.springframework.test.util.AssertionErrors.*; * @author Keesun Baik * @author Rossen Stoyanchev * @author Sebastien Deleuze + * @author Brian Clozel * @since 3.2 */ public class StatusResultMatchers { @@ -561,6 +562,14 @@ public class StatusResultMatchers { return matcher(HttpStatus.valueOf(431)); } + /** + * Assert the response status code is {@code HttpStatus.UNAVAILABLE_FOR_LEGAL_REASONS} (451). + * @since 4.3 + */ + public ResultMatcher isUnavailableForLegalReasons() { + return matcher(HttpStatus.valueOf(451)); + } + /** * Assert the response status code is {@code HttpStatus.INTERNAL_SERVER_ERROR} (500). */