Polish MockCookieTests

See gh-37134
See gh-37136
This commit is contained in:
Sam Brannen
2026-08-18 18:24:54 +02:00
parent b20d31a5cd
commit 04e5c92162
@@ -22,6 +22,7 @@ import java.time.format.DateTimeParseException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.NullAndEmptySource;
import org.junit.jupiter.params.provider.ValueSource;
import static org.assertj.core.api.Assertions.assertThat;
@@ -114,16 +115,10 @@ class MockCookieTests {
assertThat(cookie.getValue()).isEqualTo(value);
}
@Test
void parseNullHeader() {
assertThatIllegalArgumentException()
.isThrownBy(() -> MockCookie.parse(null))
.withMessageContaining("Set-Cookie header must not be null or empty");
}
@ParameterizedTest
@ValueSource(strings = {"", " "})
void parseEmptyHeader(String header) {
@NullAndEmptySource
@ValueSource(strings = " ")
void parseNullOrEmptyHeader(String header) {
assertThatIllegalArgumentException()
.isThrownBy(() -> MockCookie.parse(header))
.withMessageContaining("Set-Cookie header must not be null or empty");