diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/DefaultLeaderElectionTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/DefaultLeaderElectionTest.java index d50db45ee25f3b..dd11b45d662171 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/DefaultLeaderElectionTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/DefaultLeaderElectionTest.java @@ -186,7 +186,9 @@ void testRunAsLeader() throws Exception { .isEqualTo(serviceRunAsLeaderFuture); assertThat(componentIdRef).hasValue(DEFAULT_TEST_COMPONENT_ID); assertThat(leaderSessionIDRef).hasValue(expectedLeaderSessionID); - assertThat(callbackRef).as("The callback wasn't altered.").isSameAs(actualCallback); + assertThat(callbackRef.get()) + .as("The callback wasn't altered.") + .isSameAs(actualCallback); } }