This commit is contained in:
Stéphane Nicoll
2024-05-06 17:38:52 +02:00
parent 04944a1f56
commit 371d1a02f2
2 changed files with 6 additions and 6 deletions

View File

@@ -70,7 +70,7 @@ public class HttpHeadersAssert extends AbstractMapAssert<HttpHeadersAssert, Http
* @param name the name of an HTTP header that should not be present
* @see #doesNotContainKey
*/
public HttpHeadersAssert doesNotContainsHeader(String name) {
public HttpHeadersAssert doesNotContainHeader(String name) {
return doesNotContainKey(name);
}

View File

@@ -62,12 +62,12 @@ class HttpHeadersAssertTests {
}
@Test
void doesNotContainsHeader() {
assertThat(Map.of("first", "1")).doesNotContainsHeader("second");
void doesNotContainHeader() {
assertThat(Map.of("first", "1")).doesNotContainHeader("second");
}
@Test
void doesNotContainsHeaderWithNamePresent() {
void doesNotContainHeaderWithNamePresent() {
Map<String, String> map = Map.of("first", "1");
Assertions.assertThatExceptionOfType(AssertionError.class)
.isThrownBy(() -> assertThat(map).doesNotContainKey("first"))
@@ -75,13 +75,13 @@ class HttpHeadersAssertTests {
}
@Test
void doesNotContainsHeaders() {
void doesNotContainHeaders() {
assertThat(Map.of("first", "1", "third", "3"))
.doesNotContainsHeaders("second", "fourth");
}
@Test
void doesNotContainsHeadersWithSeveralNamesPresent() {
void doesNotContainHeadersWithSeveralNamesPresent() {
Map<String, String> map = Map.of("first", "1", "second", "2", "third", "3");
Assertions.assertThatExceptionOfType(AssertionError.class)
.isThrownBy(() -> assertThat(map).doesNotContainsHeaders("first", "another-wrong-name", "second"))