We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7211db9 commit 21ed8aaCopy full SHA for 21ed8aa
spring-test/src/test/java/org/springframework/test/web/reactive/server/HeaderAssertionTests.java
@@ -105,6 +105,17 @@ void valueMatches() {
105
"[.*ISO-8859-1.*]"));
106
}
107
108
+ @Test
109
+ void valueMatchesWithNonexistentHeader() {
110
+ HttpHeaders headers = new HttpHeaders();
111
+ headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
112
+ HeaderAssertions assertions = headerAssertions(headers);
113
+
114
+ assertThatExceptionOfType(AssertionError.class)
115
+ .isThrownBy(() -> assertions.valueMatches("Content-XYZ", ".*ISO-8859-1.*"))
116
+ .withMessage("Response header 'Content-XYZ' not found");
117
+ }
118
119
@Test
120
void valuesMatch() {
121
HttpHeaders headers = new HttpHeaders();
0 commit comments