Polish MockCookieTests

See gh-37134
This commit is contained in:
Sam Brannen
2026-08-13 12:41:41 +02:00
parent 8b894933ae
commit 27a85be4e0
@@ -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");