Introduce not-null precondition for MockCookie parsing

This commit is contained in:
Sam Brannen
2018-10-02 13:07:20 +02:00
parent 77205ca165
commit e63bffcfa0
2 changed files with 9 additions and 1 deletions

View File

@@ -80,6 +80,13 @@ public class MockCookieTests {
assertEquals("Lax", cookie.getSameSite());
}
@Test
public void parseNullHeader() {
exception.expect(IllegalArgumentException.class);
exception.expectMessage("Set-Cookie header must not be null");
MockCookie.parse(null);
}
@Test
public void parseInvalidHeader() {
exception.expect(IllegalArgumentException.class);