Session.delete -> deleteById
Fixes gh-809
This commit is contained in:
@@ -92,7 +92,7 @@ public class RedisOperationsSessionRepositoryITests extends AbstractITests {
|
||||
|
||||
this.registry.clear();
|
||||
|
||||
this.repository.delete(toSave.getId());
|
||||
this.repository.deleteById(toSave.getId());
|
||||
|
||||
assertThat(this.repository.findById(toSave.getId())).isNull();
|
||||
assertThat(this.registry.<SessionDestroyedEvent>getEvent(toSave.getId()))
|
||||
@@ -123,7 +123,7 @@ public class RedisOperationsSessionRepositoryITests extends AbstractITests {
|
||||
assertThat(session.<String>getAttribute("a")).isEqualTo(Optional.of("b"));
|
||||
assertThat(session.<String>getAttribute("1")).isEqualTo(Optional.of("2"));
|
||||
|
||||
this.repository.delete(toSave.getId());
|
||||
this.repository.deleteById(toSave.getId());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -140,7 +140,7 @@ public class RedisOperationsSessionRepositoryITests extends AbstractITests {
|
||||
assertThat(findByPrincipalName).hasSize(1);
|
||||
assertThat(findByPrincipalName.keySet()).containsOnly(toSave.getId());
|
||||
|
||||
this.repository.delete(toSave.getId());
|
||||
this.repository.deleteById(toSave.getId());
|
||||
assertThat(this.registry.receivedEvent(toSave.getId())).isTrue();
|
||||
|
||||
findByPrincipalName = this.repository.findByIndexNameAndIndexValue(INDEX_NAME,
|
||||
@@ -310,7 +310,7 @@ public class RedisOperationsSessionRepositoryITests extends AbstractITests {
|
||||
assertThat(findByPrincipalName).hasSize(1);
|
||||
assertThat(findByPrincipalName.keySet()).containsOnly(toSave.getId());
|
||||
|
||||
this.repository.delete(toSave.getId());
|
||||
this.repository.deleteById(toSave.getId());
|
||||
assertThat(this.registry.receivedEvent(toSave.getId())).isTrue();
|
||||
|
||||
findByPrincipalName = this.repository.findByIndexNameAndIndexValue(INDEX_NAME,
|
||||
|
||||
@@ -466,7 +466,7 @@ public class RedisOperationsSessionRepository implements
|
||||
return loaded;
|
||||
}
|
||||
|
||||
public void delete(String sessionId) {
|
||||
public void deleteById(String sessionId) {
|
||||
RedisSession session = getSession(sessionId, true);
|
||||
if (session == null) {
|
||||
return;
|
||||
|
||||
@@ -344,7 +344,7 @@ public class RedisOperationsSessionRepositoryTests {
|
||||
.willReturn(this.boundSetOperations);
|
||||
|
||||
String id = expected.getId();
|
||||
this.redisRepository.delete(id);
|
||||
this.redisRepository.deleteById(id);
|
||||
|
||||
assertThat(getDelta().get(RedisOperationsSessionRepository.MAX_INACTIVE_ATTR))
|
||||
.isEqualTo(0);
|
||||
@@ -358,7 +358,7 @@ public class RedisOperationsSessionRepositoryTests {
|
||||
.willReturn(this.boundHashOperations);
|
||||
|
||||
String id = "abc";
|
||||
this.redisRepository.delete(id);
|
||||
this.redisRepository.deleteById(id);
|
||||
verify(this.redisOperations, times(0)).delete(anyString());
|
||||
verify(this.redisOperations, times(0)).delete(anyString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user