You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/26 16:19:47 UTC

[GitHub] [dolphinscheduler] github-code-scanning[bot] commented on a diff in pull request #12153: [Improvement][Test] Remove Powermock in dolphinscheduler-task-plugin

github-code-scanning[bot] commented on code in PR #12153:
URL: https://github.com/apache/dolphinscheduler/pull/12153#discussion_r980258490


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sagemaker/src/test/java/org/apache/dolphinscheduler/plugin/task/sagemaker/SagemakerTaskTest.java:
##########
@@ -66,34 +59,29 @@
         TaskExecutionContext taskExecutionContext = Mockito.mock(TaskExecutionContext.class);
         Mockito.when(taskExecutionContext.getTaskParams()).thenReturn(parameters);
 
-        client = mock(AmazonSageMaker.class);
+        client = Mockito.mock(AmazonSageMaker.class);
         sagemakerTask = new SagemakerTask(taskExecutionContext);
         sagemakerTask.init();
 
-        StartPipelineExecutionResult startPipelineExecutionResult = mock(StartPipelineExecutionResult.class);
-        when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+        StartPipelineExecutionResult startPipelineExecutionResult = Mockito.mock(StartPipelineExecutionResult.class);
+        Mockito.when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
 
-        StopPipelineExecutionResult stopPipelineExecutionResult = mock(StopPipelineExecutionResult.class);
-        when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+        StopPipelineExecutionResult stopPipelineExecutionResult = Mockito.mock(StopPipelineExecutionResult.class);
+        Mockito.when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
 
-        DescribePipelineExecutionResult describePipelineExecutionResult = mock(DescribePipelineExecutionResult.class);
-        when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing", "Succeeded");
+        DescribePipelineExecutionResult describePipelineExecutionResult = Mockito.mock(DescribePipelineExecutionResult.class);
+        Mockito.when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing", "Succeeded");
 
         ListPipelineExecutionStepsResult listPipelineExecutionStepsResult =
-                mock(ListPipelineExecutionStepsResult.class);
-        PipelineExecutionStep pipelineExecutionStep = mock(PipelineExecutionStep.class);
+            Mockito.mock(ListPipelineExecutionStepsResult.class);

Review Comment:
   ## Unread local variable
   
   Variable 'ListPipelineExecutionStepsResult listPipelineExecutionStepsResult' is never read.
   
   [Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1562)



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

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