Package org.springframework.security.web.authentication.rememberme.AbstractRememberMeServicesTests

Examples of org.springframework.security.web.authentication.rememberme.AbstractRememberMeServicesTests.MockRememberMeServices


    public void httpOnlySetInServlet30DefaultConstructor() throws Exception {
        HttpServletRequest request = mock(HttpServletRequest.class);
        when(request.getContextPath()).thenReturn("/contextpath");
        HttpServletResponse response = mock(HttpServletResponse.class);
        ArgumentCaptor<Cookie> cookie = ArgumentCaptor.forClass(Cookie.class);
        MockRememberMeServices services = new MockRememberMeServices();
        services.setCookie(new String[] {"mycookie"}, 1000, request, response);
        verify(response).addCookie(cookie.capture());
        verifyStatic();
        ReflectionUtils.invokeMethod(same(method), eq(cookie.getValue()), eq(true));
    }
View Full Code Here


    public void httpOnlySetInServlet30() throws Exception {
        HttpServletRequest request = mock(HttpServletRequest.class);
        when(request.getContextPath()).thenReturn("/contextpath");
        HttpServletResponse response = mock(HttpServletResponse.class);
        ArgumentCaptor<Cookie> cookie = ArgumentCaptor.forClass(Cookie.class);
        MockRememberMeServices services = new MockRememberMeServices("key",mock(UserDetailsService.class));
        services.setCookie(new String[] {"mycookie"}, 1000, request, response);
        verify(response).addCookie(cookie.capture());
        verifyStatic();
        ReflectionUtils.invokeMethod(same(method), eq(cookie.getValue()), eq(true));
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.web.authentication.rememberme.AbstractRememberMeServicesTests.MockRememberMeServices

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.