spuru9 commented on code in PR #28561:
URL: https://github.com/apache/flink/pull/28561#discussion_r3521015447


##########
flink-libraries/flink-state-processing-api/src/test/java/org/apache/flink/state/api/input/BufferingCollectorTest.java:
##########
@@ -18,27 +18,27 @@
 
 package org.apache.flink.state.api.input;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
 
 /** Test of the buffering collector. */
-public class BufferingCollectorTest {
+class BufferingCollectorTest {
 
     @Test
-    public void testNestRemovesElement() {
+    void testNestRemovesElement() {
         BufferingCollector<Integer> collector = new BufferingCollector<>();
 
         collector.collect(1);
 
-        Assert.assertTrue("Failed to add element to collector", 
collector.hasNext());
-        Assert.assertEquals(
-                "Incorrect element removed from collector", 
Integer.valueOf(1), collector.next());
-        Assert.assertFalse("Failed to drop element from collector", 
collector.hasNext());
+        assertThat(collector).as("Failed to add element to 
collector").hasNext();
+        assertThat(collector.next()).as("Incorrect element removed from 
collector").isOne();
+        assertThat(collector).as("Failed to drop element from 
collector").isExhausted();
     }
 
     @Test
-    public void testEmptyCollectorReturnsNull() {
+    void testEmptyCollectorReturnsNull() {
         BufferingCollector<Integer> collector = new BufferingCollector<>();
-        Assert.assertNull("Empty collector did not return null", 
collector.next());
+        assertThat(collector.next()).isNull();

Review Comment:
   next() calls ArrayDeque.poll(), which returns null (not throws) when empty — 
so it's genuinely null, and this test pins that. It mirrors the original 
assertNull(...). isExhausted() would only check hasNext(), not the null-return 
this test is named for.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to