CurrentUserCookieFactory { public Cookie getNullCookie() { Cookie currentUserCookie = new Cookie(CURRENT_USER_COOKIE_NAME, null); currentUserCookie.setHttpOnly(false); currentUserCookie.setMaxAge(0); currentUserCookie.setPath("/"); return currentUserCookie; } CurrentUserCookieFactory(int sessionTimeout, boolean secure); Cookie getCookie(UaaPrincipal uaaPrincipal); Cookie getNullCookie(); public String CURRENT_USER_COOKIE_NAME; }
@Test void getNullCookie() { Cookie cookie = factory.getNullCookie(); assertEquals("Current-User", cookie.getName()); assertFalse(cookie.isHttpOnly()); assertEquals(0, cookie.getMaxAge()); assertEquals("/", cookie.getPath()); }