diff --git a/spring-session-data-redis/src/integration-test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryDynamicITests.java b/spring-session-data-redis/src/integration-test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryDynamicITests.java index efe77a1c3..b7247356c 100644 --- a/spring-session-data-redis/src/integration-test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryDynamicITests.java +++ b/spring-session-data-redis/src/integration-test/java/org/springframework/session/data/redis/RedisIndexedSessionRepositoryDynamicITests.java @@ -37,10 +37,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.BDDMockito.given; -import static org.mockito.BDDMockito.willAnswer; import static org.mockito.Mockito.spy; /** @@ -68,10 +66,6 @@ void findByIdWhenSessionDeletedWhileSavingDeltaThenThrowIllegalStateException() BoundHashOperations opsForHash = spy(this.spyOperations.boundHashOps(anyString())); given(this.spyOperations.boundHashOps(anyString())).willReturn(opsForHash); - willAnswer((invocation) -> { - this.sessionRepository.deleteById(session.getId()); - return invocation.callRealMethod(); - }).given(opsForHash).putAll(any()); this.sessionRepository.save(session); assertThatIllegalStateException().isThrownBy(() -> this.sessionRepository.findById(session.getId())) @@ -87,10 +81,6 @@ void findByIdWhenSessionDeletedWhileSavingDeltaAndSafeMapperThenSessionIsNull() BoundHashOperations opsForHash = spy(this.spyOperations.boundHashOps(anyString())); given(this.spyOperations.boundHashOps(anyString())).willReturn(opsForHash); - willAnswer((invocation) -> { - this.sessionRepository.deleteById(session.getId()); - return invocation.callRealMethod(); - }).given(opsForHash).putAll(any()); this.sessionRepository.save(session); assertThat(this.sessionRepository.findById(session.getId())).isNull();