Jiabao-Sun commented on code in PR #23200:
URL: https://github.com/apache/flink/pull/23200#discussion_r1299313599


##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ProducerFailedExceptionTest.java:
##########
@@ -21,26 +21,26 @@
 import org.apache.flink.runtime.execution.CancelTaskException;
 import org.apache.flink.util.SerializedThrowable;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /** Tests for {@link ProducerFailedException}. */
-public class ProducerFailedExceptionTest {
+class ProducerFailedExceptionTest {
 
     @Test
-    public void testInstanceOfCancelTaskException() throws Exception {
-        
assertTrue(CancelTaskException.class.isAssignableFrom(ProducerFailedException.class));
+    void testInstanceOfCancelTaskException() throws Exception {
+        
assertThat(CancelTaskException.class.isAssignableFrom(ProducerFailedException.class))
+                .isTrue();
     }
 
     @Test
-    public void testCauseIsSerialized() throws Exception {
+    void testCauseIsSerialized() throws Exception {
         // Tests that the cause is stringified, because it might be an instance
         // of a user level Exception, which can not be deserialized by the
         // remote receiver's system class loader.
         ProducerFailedException e = new ProducerFailedException(new 
Exception());
-        assertNotNull(e.getCause());
-        assertTrue(e.getCause() instanceof SerializedThrowable);
+        assertThat(e.getCause()).isNotNull();

Review Comment:
   Thanks for catching this!
   Fixed.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ProducerFailedExceptionTest.java:
##########
@@ -21,26 +21,26 @@
 import org.apache.flink.runtime.execution.CancelTaskException;
 import org.apache.flink.util.SerializedThrowable;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 /** Tests for {@link ProducerFailedException}. */
-public class ProducerFailedExceptionTest {
+class ProducerFailedExceptionTest {
 
     @Test
-    public void testInstanceOfCancelTaskException() throws Exception {
-        
assertTrue(CancelTaskException.class.isAssignableFrom(ProducerFailedException.class));
+    void testInstanceOfCancelTaskException() throws Exception {
+        
assertThat(CancelTaskException.class.isAssignableFrom(ProducerFailedException.class))
+                .isTrue();
     }
 
     @Test
-    public void testCauseIsSerialized() throws Exception {
+    void testCauseIsSerialized() throws Exception {
         // Tests that the cause is stringified, because it might be an instance
         // of a user level Exception, which can not be deserialized by the
         // remote receiver's system class loader.
         ProducerFailedException e = new ProducerFailedException(new 
Exception());
-        assertNotNull(e.getCause());
-        assertTrue(e.getCause() instanceof SerializedThrowable);
+        assertThat(e.getCause()).isNotNull();
+        assertThat(e.getCause()).isInstanceOf(SerializedThrowable.class);

Review Comment:
   Thanks for catching this!
   Fixed.



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