use of org.apache.commons.httpclient.cookie.CookieSpec in project zaproxy by zaproxy.
the class ZapCookieSpecUnitTest method shouldThrowWhenValidatingWithNullHost.
@Test
void shouldThrowWhenValidatingWithNullHost() throws MalformedCookieException {
// Given
CookieSpec cookieSpec = createCookieSpec();
String host = null;
// When / Then
assertThrows(IllegalArgumentException.class, () -> cookieSpec.validate(host, PORT, PATH, SECURE, new Cookie()));
}
use of org.apache.commons.httpclient.cookie.CookieSpec in project zaproxy by zaproxy.
the class ZapCookieSpecUnitTest method shouldBeValidEvenIfCookiePathIsDifferentThanOrigin.
@Test
void shouldBeValidEvenIfCookiePathIsDifferentThanOrigin() throws MalformedCookieException {
// Given
CookieSpec cookieSpec = createCookieSpec();
Cookie cookie = new Cookie(HOST, "name", "value");
cookie.setPath("/other/path/");
// When / Then
assertDoesNotThrow(() -> cookieSpec.validate(HOST, PORT, PATH, SECURE, cookie));
}
Aggregations