Refactor Redis configuration

Closes gh-941
This commit is contained in:
Vedran Pavic
2017-11-27 20:28:41 +01:00
parent 41de1b087a
commit 6a370b1ef8
3 changed files with 12 additions and 47 deletions

View File

@@ -110,27 +110,11 @@ public class RedisOperationsSessionRepositoryTests {
this.cached.setLastAccessedTime(Instant.ofEpochMilli(1404360000000L));
}
@Test(expected = IllegalArgumentException.class)
public void constructorNullConnectionFactory() {
new RedisOperationsSessionRepository((RedisConnectionFactory) null);
}
@Test(expected = IllegalArgumentException.class)
public void setApplicationEventPublisherNull() {
this.redisRepository.setApplicationEventPublisher(null);
}
// gh-61
@Test
public void constructorConnectionFactory() {
this.redisRepository = new RedisOperationsSessionRepository(this.factory);
RedisSession session = this.redisRepository.createSession();
given(this.factory.getConnection()).willReturn(this.connection);
this.redisRepository.save(session);
}
@Test
public void changeSessionId() {
RedisSession createSession = this.redisRepository.createSession();