use of org.springframework.session.data.redis.RedisOperationsSessionRepository in project spring-boot by spring-projects.
the class SessionAutoConfigurationRedisTests method redisSessionStoreWithCustomizations.
@Test
public void redisSessionStoreWithCustomizations() {
load(Collections.<Class<?>>singletonList(RedisAutoConfiguration.class), "spring.session.store-type=redis", "spring.session.redis.namespace=foo", "spring.session.redis.flush-mode=immediate");
RedisOperationsSessionRepository repository = validateSessionRepository(RedisOperationsSessionRepository.class);
assertThat(repository.getSessionCreatedChannelPrefix()).isEqualTo("spring:session:foo:event:created:");
assertThat(new DirectFieldAccessor(repository).getPropertyValue("redisFlushMode")).isEqualTo(RedisFlushMode.IMMEDIATE);
}
use of org.springframework.session.data.redis.RedisOperationsSessionRepository in project spring-boot by spring-projects.
the class SessionAutoConfigurationRedisTests method validateSpringSessionUsesRedis.
private void validateSpringSessionUsesRedis() {
RedisOperationsSessionRepository repository = validateSessionRepository(RedisOperationsSessionRepository.class);
assertThat(repository.getSessionCreatedChannelPrefix()).isEqualTo("spring:session:event:created:");
assertThat(new DirectFieldAccessor(repository).getPropertyValue("redisFlushMode")).isEqualTo(RedisFlushMode.ON_SAVE);
}
Aggregations