1996fanrui commented on code in PR #23200:
URL: https://github.com/apache/flink/pull/23200#discussion_r1296100988


##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/writer/RecordWriterTest.java:
##########
@@ -51,43 +51,31 @@
 import org.apache.flink.types.IntValue;
 import org.apache.flink.util.XORShiftRandom;
 
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayDeque;
 import java.util.Random;
 
 import static 
org.apache.flink.runtime.io.network.partition.PartitionTestUtils.createPartition;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /** Tests for the {@link RecordWriter}. */
-public class RecordWriterTest {
+class RecordWriterTest {
 
-    private final boolean isBroadcastWriter;
+    boolean isBroadcastWriter = false;

Review Comment:
   How about adding a `boolean isBroadcastWriter()` mothod and removing all 
constructors and the `isBroadcastWriter` filed?
   
   
   // Add the `boolean isBroadcastWriter()` to `RecordWriterTest`, it returns 
`false`.
   
   ```
       protected boolean isBroadcastWriter() {
           return false;
       }
   ```
   
   // Add the `isBroadcastWriter()` to `BroadcastRecordWriterTest`, it returns 
`true`.
   
   ```
       protected boolean isBroadcastWriter() {
           return true;
       }
   ```
   
   All callers call the method instead of filed. I have tried it on my Mac, it 
works well.
   
   
![](https://github.com/apache/flink/assets/38427477/a6f0a786-0745-4252-bca0-6e3f2a7cb830)
   



-- 
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