Skip to content

Commit bde989f

Browse files
Do not use mock for Rename Operation Exception Test
Issue gh-2645
1 parent ebeb5b3 commit bde989f

File tree

2 files changed

+15
-103
lines changed

2 files changed

+15
-103
lines changed

spring-session-data-redis/src/integration-test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryDynamicITests.java

Lines changed: 0 additions & 103 deletions
This file was deleted.

spring-session-data-redis/src/integration-test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryITests.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.springframework.test.context.web.WebAppConfiguration;
4848

4949
import static org.assertj.core.api.Assertions.assertThat;
50+
import static org.assertj.core.api.Assertions.assertThatNoException;
5051

5152
/**
5253
* Integration tests for {@link RedisIndexedSessionRepository}.
@@ -682,6 +683,20 @@ void changeSessionIdSaveConcurrently() {
682683
assertThat(this.repository.findById(copy2.getId())).isNull();
683684
}
684685

686+
// gh-1743
687+
@Test
688+
void saveChangeSessionIdWhenFailedRenameOperationExceptionThenIgnoreError() {
689+
RedisSession toSave = this.repository.createSession();
690+
String sessionId = toSave.getId();
691+
692+
this.repository.save(toSave);
693+
RedisSession session = this.repository.findById(sessionId);
694+
this.repository.deleteById(sessionId);
695+
session.changeSessionId();
696+
697+
assertThatNoException().isThrownBy(() -> this.repository.save(session));
698+
}
699+
685700
private String getSecurityName() {
686701
return this.context.getAuthentication().getName();
687702
}

0 commit comments

Comments
 (0)