mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 08:24:13 +00:00
Polish MockCookieTests
See gh-37134
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user