use of org.springframework.session.MapSessionRepository in project spring-boot by spring-projects.
the class SessionAutoConfigurationTests method springSessionTimeoutIsNotAValidProperty.
@Test
public void springSessionTimeoutIsNotAValidProperty() {
load("spring.session.store-type=hash-map", "spring.session.timeout=3000");
MapSessionRepository repository = validateSessionRepository(MapSessionRepository.class);
assertThat(getSessionTimeout(repository)).isNull();
}
use of org.springframework.session.MapSessionRepository in project spring-boot by spring-projects.
the class SessionAutoConfigurationTests method hashMapSessionStore.
@Test
public void hashMapSessionStore() {
load("spring.session.store-type=hash-map");
MapSessionRepository repository = validateSessionRepository(MapSessionRepository.class);
assertThat(getSessionTimeout(repository)).isNull();
}
use of org.springframework.session.MapSessionRepository in project spring-boot by spring-projects.
the class HashMapSessionConfiguration method sessionRepository.
@Bean
public SessionRepository<ExpiringSession> sessionRepository(SessionProperties properties) {
MapSessionRepository repository = new MapSessionRepository();
Integer timeout = properties.getTimeout();
if (timeout != null) {
repository.setDefaultMaxInactiveInterval(timeout);
}
return repository;
}
use of org.springframework.session.MapSessionRepository in project spring-session by spring-projects.
the class SessionRepositoryFilterTests method setup.
@Before
public void setup() throws Exception {
this.sessions = new HashMap<>();
this.sessionRepository = new MapSessionRepository(this.sessions);
this.filter = new SessionRepositoryFilter<>(this.sessionRepository);
setupRequest();
}
use of org.springframework.session.MapSessionRepository in project spring-session by spring-projects.
the class SessionRepositoryFilterTests method doFilterLazySessionCreation.
@Test
public void doFilterLazySessionCreation() throws Exception {
SessionRepository<MapSession> sessionRepository = spy(new MapSessionRepository(new ConcurrentHashMap<>()));
this.filter = new SessionRepositoryFilter<>(sessionRepository);
doFilter(new DoInFilter() {
@Override
public void doFilter(HttpServletRequest wrappedRequest, HttpServletResponse wrappedResponse) throws IOException {
}
});
verifyZeroInteractions(sessionRepository);
}
Aggregations