|
@@ -60,16 +60,16 @@ public class CookieClearingLogoutHandlerTests {
|
|
assertThat(c.getMaxAge()).isZero();
|
|
assertThat(c.getMaxAge()).isZero();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void passedInCookiesAreCleared() {
|
|
public void passedInCookiesAreCleared() {
|
|
MockHttpServletResponse response = new MockHttpServletResponse();
|
|
MockHttpServletResponse response = new MockHttpServletResponse();
|
|
MockHttpServletRequest request = new MockHttpServletRequest();
|
|
MockHttpServletRequest request = new MockHttpServletRequest();
|
|
request.setContextPath("/foo/bar");
|
|
request.setContextPath("/foo/bar");
|
|
- Cookie cookie1 = new Cookie("my_cookie",null);
|
|
|
|
|
|
+ Cookie cookie1 = new Cookie("my_cookie", null);
|
|
cookie1.setPath("/foo");
|
|
cookie1.setPath("/foo");
|
|
cookie1.setMaxAge(0);
|
|
cookie1.setMaxAge(0);
|
|
- Cookie cookie2 = new Cookie("my_cookie_too",null);
|
|
|
|
|
|
+ Cookie cookie2 = new Cookie("my_cookie_too", null);
|
|
cookie2.setPath("/foo");
|
|
cookie2.setPath("/foo");
|
|
cookie2.setMaxAge(0);
|
|
cookie2.setMaxAge(0);
|
|
CookieClearingLogoutHandler handler = new CookieClearingLogoutHandler(cookie1, cookie2);
|
|
CookieClearingLogoutHandler handler = new CookieClearingLogoutHandler(cookie1, cookie2);
|
|
@@ -80,13 +80,13 @@ public class CookieClearingLogoutHandlerTests {
|
|
assertThat(c.getMaxAge()).isZero();
|
|
assertThat(c.getMaxAge()).isZero();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@Test(expected=IllegalArgumentException.class)
|
|
@Test(expected=IllegalArgumentException.class)
|
|
public void invalidAge() {
|
|
public void invalidAge() {
|
|
MockHttpServletResponse response = new MockHttpServletResponse();
|
|
MockHttpServletResponse response = new MockHttpServletResponse();
|
|
MockHttpServletRequest request = new MockHttpServletRequest();
|
|
MockHttpServletRequest request = new MockHttpServletRequest();
|
|
request.setContextPath("/foo/bar");
|
|
request.setContextPath("/foo/bar");
|
|
- Cookie cookie1 = new Cookie("my_cookie",null);
|
|
|
|
|
|
+ Cookie cookie1 = new Cookie("my_cookie", null);
|
|
cookie1.setPath("/foo");
|
|
cookie1.setPath("/foo");
|
|
cookie1.setMaxAge(100);
|
|
cookie1.setMaxAge(100);
|
|
CookieClearingLogoutHandler handler = new CookieClearingLogoutHandler(cookie1);
|
|
CookieClearingLogoutHandler handler = new CookieClearingLogoutHandler(cookie1);
|