From ff1bd607193cd0dd4a90bd1e6fc4bb7a002b3e52 Mon Sep 17 00:00:00 2001 From: Rob Winch <362503+rwinch@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:20:05 -0600 Subject: [PATCH] Fix unstubbed Exception for spring-test-6.2.0 --- .../RedisIndexedSessionRepositoryDynamicITests.java | 10 ---------- 1 file changed, 10 deletions(-) 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();