Skip to content

Commit 448d6c6

Browse files
committed
Merge branch '6.2.x'
2 parents 05d8604 + d280358 commit 448d6c6

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

spring-test/src/main/java/org/springframework/test/http/HttpHeadersAssert.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -116,8 +116,9 @@ public HttpHeadersAssert doesNotContainHeader(String name) {
116116
* Verify that the actual HTTP headers do not contain any of the headers
117117
* with the given {@code names}.
118118
* @param names the names of HTTP headers that should not be present
119+
* @since 6.2.2
119120
*/
120-
public HttpHeadersAssert doesNotContainsHeaders(String... names) {
121+
public HttpHeadersAssert doesNotContainHeaders(String... names) {
121122
this.namesAssert
122123
.as("check headers does not contain HTTP headers '%s'", Arrays.toString(names))
123124
.doesNotContain(names);

spring-test/src/test/java/org/springframework/test/http/HttpHeadersAssertTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -78,14 +78,14 @@ void doesNotContainHeaderWithNamePresent() {
7878
@Test
7979
void doesNotContainHeaders() {
8080
assertThat(Map.of("first", "1", "third", "3"))
81-
.doesNotContainsHeaders("second", "fourth");
81+
.doesNotContainHeaders("second", "fourth");
8282
}
8383

8484
@Test
8585
void doesNotContainHeadersWithSeveralNamesPresent() {
8686
Map<String, String> map = Map.of("first", "1", "second", "2", "third", "3");
8787
assertThatExceptionOfType(AssertionError.class)
88-
.isThrownBy(() -> assertThat(map).doesNotContainsHeaders("first", "another-wrong-name", "second"))
88+
.isThrownBy(() -> assertThat(map).doesNotContainHeaders("first", "another-wrong-name", "second"))
8989
.withMessageContainingAll("HTTP headers", "first", "second");
9090
}
9191

0 commit comments

Comments
 (0)