use of org.springframework.session.MapSession in project spring-session by spring-projects.
the class SpringSessionBackedSessionRegistryTest method createSession.
private Session createSession(String sessionId, String userName, Instant lastAccessed) {
MapSession session = new MapSession(sessionId);
session.setLastAccessedTime(lastAccessed);
Authentication authentication = mock(Authentication.class);
when(authentication.getName()).thenReturn(userName);
SecurityContextImpl securityContext = new SecurityContextImpl();
securityContext.setAuthentication(authentication);
session.setAttribute("SPRING_SECURITY_CONTEXT", securityContext);
return session;
}
use of org.springframework.session.MapSession in project spring-session by spring-projects.
the class CookieHttpSessionIdResolverTests method setup.
@Before
public void setup() throws Exception {
this.cookieName = "SESSION";
this.session = new MapSession();
this.request = new MockHttpServletRequest();
this.response = new MockHttpServletResponse();
this.strategy = new CookieHttpSessionIdResolver();
}
Aggregations