wangzzu commented on code in PR #23242:
URL: https://github.com/apache/flink/pull/23242#discussion_r1301154971


##########
flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/InFlightRequestTrackerTest.java:
##########
@@ -18,70 +18,65 @@
 
 package org.apache.flink.runtime.rest.handler;
 
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.util.concurrent.CompletableFuture;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /** Tests for {@link InFlightRequestTracker}. */
-public class InFlightRequestTrackerTest {
+class InFlightRequestTrackerTest {
 
     private InFlightRequestTracker inFlightRequestTracker;
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         inFlightRequestTracker = new InFlightRequestTracker();
     }
 
     @Test
-    public void testShouldFinishAwaitAsyncImmediatelyIfNoRequests() {
-        assertTrue(inFlightRequestTracker.awaitAsync().isDone());
+    void testShouldFinishAwaitAsyncImmediatelyIfNoRequests() {
+        assertThat(inFlightRequestTracker.awaitAsync()).isDone();
     }
 
     @Test
-    public void testShouldFinishAwaitAsyncIffAllRequestsDeregistered() {
+    void testShouldFinishAwaitAsyncIffAllRequestsDeregistered() {
         inFlightRequestTracker.registerRequest();
 
         final CompletableFuture<Void> awaitFuture = 
inFlightRequestTracker.awaitAsync();
-        assertFalse(awaitFuture.isDone());
+        assertThat(awaitFuture).isNotDone();
 
         inFlightRequestTracker.deregisterRequest();
-        assertTrue(awaitFuture.isDone());
+        assertThat(awaitFuture).isDone();
     }
 
     @Test
-    public void testAwaitAsyncIsIdempotent() {
+    void testAwaitAsyncIsIdempotent() {
         final CompletableFuture<Void> awaitFuture = 
inFlightRequestTracker.awaitAsync();
-        assertTrue(awaitFuture.isDone());
-
-        assertSame(
-                "The reference to the future must not change",
-                awaitFuture,
-                inFlightRequestTracker.awaitAsync());
+        assertThat(awaitFuture).isDone();
+        assertThat(awaitFuture)
+                .as("The reference to the future must not change")
+                .isEqualTo(inFlightRequestTracker.awaitAsync());

Review Comment:
   `isCompletedWithValue` cannot be used on **Void**, `as` api does not exist, 
I think the current implementation is also OK



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to