You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to this commit, one could not test for the absence of
a specific HTTP header in a response.
Using header("X-Custom-Header", Matchers.nullValue()) would not
work because it tests for an empty value of an existing header.
This commit adds a doesNotExist method on the
HeaderResultMatcher.
Issue: SPR-10771
Copy file name to clipboardExpand all lines: spring-test-mvc/src/test/java/org/springframework/test/web/servlet/samples/standalone/resultmatchers/HeaderAssertionTests.java
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@
35
35
36
36
/**
37
37
* Examples of expectations on response header values.
38
-
*
38
+
*
39
39
* @author Rossen Stoyanchev
40
40
* @author Sam Brannen
41
41
*/
@@ -110,6 +110,22 @@ public void longValueWithMissingResponseHeader() throws Exception {
0 commit comments