snuyanzin commented on code in PR #29436:
URL: https://github.com/apache/flink/pull/29436#discussion_r4242583023


##########
flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java:
##########
@@ -228,55 +221,55 @@ public void testRegularExecution() throws Exception {
                         .build(Executors.directExecutor());
 
         // task should be new and perfect
-        assertEquals(ExecutionState.CREATED, task.getExecutionState());
-        assertFalse(task.isCanceledOrFailed());
-        assertNull(task.getFailureCause());
+        assertThat(task.getExecutionState()).isEqualTo(ExecutionState.CREATED);
+        assertThat(task.isCanceledOrFailed()).isFalse();
+        assertThat(task.getFailureCause()).isNull();
 
         // go into the run method. we should switch to DEPLOYING, RUNNING, then
         // FINISHED, and all should be good
         task.run();
 
         // verify final state
-        assertEquals(ExecutionState.FINISHED, task.getExecutionState());
-        assertFalse(task.isCanceledOrFailed());
-        assertNull(task.getFailureCause());
-        assertNull(task.getInvokable());
+        
assertThat(task.getExecutionState()).isEqualTo(ExecutionState.FINISHED);
+        assertThat(task.isCanceledOrFailed()).isFalse();
+        assertThat(task.getFailureCause()).isNull();
+        assertThat(task.getInvokable()).isNull();
 
         
taskManagerActions.validateListenerMessage(ExecutionState.INITIALIZING, task, 
null);
         taskManagerActions.validateListenerMessage(ExecutionState.RUNNING, 
task, null);
         taskManagerActions.validateListenerMessage(ExecutionState.FINISHED, 
task, null);
     }
 
     @Test
-    public void testCancelRightAway() throws Exception {
+    void testCancelRightAway() throws Exception {
         final Task task = 
createTaskBuilder().build(Executors.directExecutor());
         task.cancelExecution();
 
-        assertEquals(ExecutionState.CANCELING, task.getExecutionState());
+        
assertThat(task.getExecutionState()).isEqualTo(ExecutionState.CANCELING);
 
         task.run();
 
         // verify final state
-        assertEquals(ExecutionState.CANCELED, task.getExecutionState());
+        
assertThat(task.getExecutionState()).isEqualTo(ExecutionState.CANCELED);
 
-        assertNull(task.getInvokable());
+        assertThat(task.getInvokable()).isNull();
     }
 
     @Test
-    public void testFailExternallyRightAway() throws Exception {
+    void testFailExternallyRightAway() throws Exception {
         final Task task = 
createTaskBuilder().build(Executors.directExecutor());
         task.failExternally(new Exception("fail externally"));
 
-        assertEquals(ExecutionState.FAILED, task.getExecutionState());
+        assertThat(task.getExecutionState()).isEqualTo(ExecutionState.FAILED);

Review Comment:
   ```suggestion
           assertThat(task.getExecutionState()).isSameAs(ExecutionState.FAILED);
   ```



##########
flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java:
##########
@@ -228,55 +221,55 @@ public void testRegularExecution() throws Exception {
                         .build(Executors.directExecutor());
 
         // task should be new and perfect
-        assertEquals(ExecutionState.CREATED, task.getExecutionState());
-        assertFalse(task.isCanceledOrFailed());
-        assertNull(task.getFailureCause());
+        assertThat(task.getExecutionState()).isEqualTo(ExecutionState.CREATED);
+        assertThat(task.isCanceledOrFailed()).isFalse();
+        assertThat(task.getFailureCause()).isNull();
 
         // go into the run method. we should switch to DEPLOYING, RUNNING, then
         // FINISHED, and all should be good
         task.run();
 
         // verify final state
-        assertEquals(ExecutionState.FINISHED, task.getExecutionState());
-        assertFalse(task.isCanceledOrFailed());
-        assertNull(task.getFailureCause());
-        assertNull(task.getInvokable());
+        
assertThat(task.getExecutionState()).isEqualTo(ExecutionState.FINISHED);
+        assertThat(task.isCanceledOrFailed()).isFalse();
+        assertThat(task.getFailureCause()).isNull();
+        assertThat(task.getInvokable()).isNull();
 
         
taskManagerActions.validateListenerMessage(ExecutionState.INITIALIZING, task, 
null);
         taskManagerActions.validateListenerMessage(ExecutionState.RUNNING, 
task, null);
         taskManagerActions.validateListenerMessage(ExecutionState.FINISHED, 
task, null);
     }
 
     @Test
-    public void testCancelRightAway() throws Exception {
+    void testCancelRightAway() throws Exception {
         final Task task = 
createTaskBuilder().build(Executors.directExecutor());
         task.cancelExecution();
 
-        assertEquals(ExecutionState.CANCELING, task.getExecutionState());
+        
assertThat(task.getExecutionState()).isEqualTo(ExecutionState.CANCELING);
 
         task.run();
 
         // verify final state
-        assertEquals(ExecutionState.CANCELED, task.getExecutionState());
+        
assertThat(task.getExecutionState()).isEqualTo(ExecutionState.CANCELED);
 
-        assertNull(task.getInvokable());
+        assertThat(task.getInvokable()).isNull();
     }
 
     @Test
-    public void testFailExternallyRightAway() throws Exception {
+    void testFailExternallyRightAway() throws Exception {
         final Task task = 
createTaskBuilder().build(Executors.directExecutor());
         task.failExternally(new Exception("fail externally"));
 
-        assertEquals(ExecutionState.FAILED, task.getExecutionState());
+        assertThat(task.getExecutionState()).isEqualTo(ExecutionState.FAILED);
 
         task.run();
 
         // verify final state
-        assertEquals(ExecutionState.FAILED, task.getExecutionState());
+        assertThat(task.getExecutionState()).isEqualTo(ExecutionState.FAILED);

Review Comment:
   ```suggestion
           assertThat(task.getExecutionState()).isSameAs(ExecutionState.FAILED);
   ```



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