@Test public void onLogout() { CookieRememberMeManager mgr = new CookieRememberMeManager(); org.apache.shiro.web.servlet.Cookie cookie = createMock(org.apache.shiro.web.servlet.Cookie.class); mgr.setCookie(cookie); HttpServletRequest mockRequest = createMock(HttpServletRequest.class); HttpServletResponse mockResponse = createMock(HttpServletResponse.class); WebSubject mockSubject = createNiceMock(WebSubject.class); expect(mockSubject.getServletRequest()).andReturn(mockRequest).anyTimes(); expect(mockSubject.getServletResponse()).andReturn(mockResponse).anyTimes(); expect(mockRequest.getContextPath()).andReturn(null).anyTimes(); cookie.removeFrom(isA(HttpServletRequest.class), isA(HttpServletResponse.class)); replay(mockRequest); replay(mockResponse); replay(mockSubject); replay(cookie); mgr.onLogout(mockSubject); verify(mockSubject); verify(mockRequest); verify(mockResponse); verify(cookie); }
@SuppressWarnings({"UnusedDeclaration"}) public void setCookie(Cookie cookie) { this.cookie = cookie; }
CookieRememberMeManager extends AbstractRememberMeManager { @SuppressWarnings({"UnusedDeclaration"}) public void setCookie(Cookie cookie) { this.cookie = cookie; } }
CookieRememberMeManager extends AbstractRememberMeManager { @SuppressWarnings({"UnusedDeclaration"}) public void setCookie(Cookie cookie) { this.cookie = cookie; } CookieRememberMeManager(); }
CookieRememberMeManager extends AbstractRememberMeManager { @SuppressWarnings({"UnusedDeclaration"}) public void setCookie(Cookie cookie) { this.cookie = cookie; } CookieRememberMeManager(); Cookie getCookie(); @SuppressWarnings({"UnusedDeclaration"}) void setCookie(Cookie cookie); void forgetIdentity(SubjectContext subjectContext); }
CookieRememberMeManager extends AbstractRememberMeManager { @SuppressWarnings({"UnusedDeclaration"}) public void setCookie(Cookie cookie) { this.cookie = cookie; } CookieRememberMeManager(); Cookie getCookie(); @SuppressWarnings({"UnusedDeclaration"}) void setCookie(Cookie cookie); void forgetIdentity(SubjectContext subjectContext); static final String DEFAULT_REMEMBER_ME_COOKIE_NAME; }