|
20 | 20 | import java.util.Map;
|
21 | 21 | import java.util.function.BiFunction;
|
22 | 22 |
|
23 |
| -import io.lettuce.core.RedisCommandExecutionException; |
24 | 23 | import org.junit.jupiter.api.Test;
|
25 | 24 | import org.junit.jupiter.api.extension.ExtendWith;
|
26 | 25 |
|
27 | 26 | import org.springframework.context.annotation.Bean;
|
28 | 27 | import org.springframework.context.annotation.Configuration;
|
29 |
| -import org.springframework.data.redis.RedisSystemException; |
30 | 28 | import org.springframework.data.redis.core.BoundHashOperations;
|
31 | 29 | import org.springframework.data.redis.core.RedisOperations;
|
32 | 30 | import org.springframework.session.MapSession;
|
|
43 | 41 | import static org.mockito.ArgumentMatchers.anyString;
|
44 | 42 | import static org.mockito.BDDMockito.given;
|
45 | 43 | import static org.mockito.BDDMockito.willAnswer;
|
46 |
| -import static org.mockito.Mockito.doThrow; |
47 | 44 | import static org.mockito.Mockito.spy;
|
48 | 45 |
|
49 | 46 | /**
|
@@ -99,30 +96,6 @@ void findByIdWhenSessionDeletedWhileSavingDeltaAndSafeMapperThenSessionIsNull()
|
99 | 96 | assertThat(this.sessionRepository.findById(session.getId())).isNull();
|
100 | 97 | }
|
101 | 98 |
|
102 |
| - // gh-1743 |
103 |
| - @Test |
104 |
| - @SuppressWarnings("unchecked") |
105 |
| - void saveChangeSessionIdWhenFailedRenameOperationExceptionContainsMoreDetailsThenIgnoreError() { |
106 |
| - this.context.register(Config.class); |
107 |
| - refreshAndPrepareFields(); |
108 |
| - |
109 |
| - RedisSession toSave = this.sessionRepository.createSession(); |
110 |
| - String sessionId = toSave.getId(); |
111 |
| - |
112 |
| - this.sessionRepository.save(toSave); |
113 |
| - RedisSession session = this.sessionRepository.findById(sessionId); |
114 |
| - this.sessionRepository.deleteById(sessionId); |
115 |
| - String newSessionId = session.changeSessionId(); |
116 |
| - |
117 |
| - RedisSystemException redisSystemException = new RedisSystemException(null, |
118 |
| - new RedisCommandExecutionException("ERR no such key. channel: [id: 0xec125091,...")); |
119 |
| - doThrow(redisSystemException).when(this.spyOperations).rename(any(), any()); |
120 |
| - |
121 |
| - this.sessionRepository.save(session); |
122 |
| - assertThat(this.sessionRepository.findById(sessionId)).isNull(); |
123 |
| - assertThat(this.sessionRepository.findById(newSessionId)).isNull(); |
124 |
| - } |
125 |
| - |
126 | 99 | @SuppressWarnings("unchecked")
|
127 | 100 | private void refreshAndPrepareFields() {
|
128 | 101 | this.context.refresh();
|
|
0 commit comments