Package org.springframework.security.core.session

Examples of org.springframework.security.core.session.SessionRegistryImpl


    //~ Methods ========================================================================================================

    @Before
    public void setUp() throws Exception {
        sessionRegistry = new SessionRegistryImpl();
    }
View Full Code Here


        // Setup our test fixture and registry to want this session to be expired
        ConcurrentSessionFilter filter = new ConcurrentSessionFilter();
        filter.setRedirectStrategy(new DefaultRedirectStrategy());
        filter.setLogoutHandlers(new LogoutHandler[] {new SecurityContextLogoutHandler()});

        SessionRegistry registry = new SessionRegistryImpl();
        registry.registerNewSession(session.getId(), "principal");
        registry.getSessionInformation(session.getId()).expireNow();
        filter.setSessionRegistry(registry);
        filter.setExpiredUrl("/expired.jsp");
        filter.afterPropertiesSet();

        FilterChain fc = mock(FilterChain.class);
View Full Code Here

        request.setSession(session);

        MockHttpServletResponse response = new MockHttpServletResponse();

        ConcurrentSessionFilter filter = new ConcurrentSessionFilter();
        SessionRegistry registry = new SessionRegistryImpl();
        registry.registerNewSession(session.getId(), "principal");
        registry.getSessionInformation(session.getId()).expireNow();
        filter.setSessionRegistry(registry);

        FilterChain fc = mock(FilterChain.class);
        filter.doFilter(request, response, fc);
        verifyZeroInteractions(fc);
View Full Code Here

        MockHttpServletResponse response = new MockHttpServletResponse();
        FilterChain fc = mock(FilterChain.class);

        // Setup our test fixture
        ConcurrentSessionFilter filter = new ConcurrentSessionFilter();
        SessionRegistry registry = new SessionRegistryImpl();
        registry.registerNewSession(session.getId(), "principal");

        Date lastRequest = registry.getSessionInformation(session.getId()).getLastRequest();
        filter.setSessionRegistry(registry);
        filter.setExpiredUrl("/expired.jsp");

        Thread.sleep(1000);

        filter.doFilter(request, response, fc);

        verify(fc).doFilter(request, response);
        assertTrue(registry.getSessionInformation(session.getId()).getLastRequest().after(lastRequest));
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.core.session.SessionRegistryImpl

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.