diff --git a/test/src/test/java/org/springframework/security/test/context/support/ReactorContextTestExecutionListenerTests.java b/test/src/test/java/org/springframework/security/test/context/support/ReactorContextTestExecutionListenerTests.java index 1b1a7e1bca..8cb4b9bf0f 100644 --- a/test/src/test/java/org/springframework/security/test/context/support/ReactorContextTestExecutionListenerTests.java +++ b/test/src/test/java/org/springframework/security/test/context/support/ReactorContextTestExecutionListenerTests.java @@ -181,7 +181,8 @@ public class ReactorContextTestExecutionListenerTests { Hooks.onLastOperator("CUSTOM_HOOK", p -> Mono.just(obj)); this.listener.afterTestMethod(this.testContext); - assertThat(Mono.subscriberContext().block()).isEqualTo(obj); + Object result = Mono.subscriberContext().block(); + assertThat(result).isEqualTo(obj); } @Test