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/10/10 12:27:52 UTC
[GitHub] [dolphinscheduler] EricGao888 opened a new pull request, #12299: Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
EricGao888 opened a new pull request, #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299
## Purpose of the pull request
* Migrate all UT cases in task-plugin module from jUnit4 to jUnit5
* Give detailed examples about how to migrate jUnit test cases.
* I will create a corresponding issue with migration instructions (SOP) and link this PR to it later today.
## Brief change log
* Already described above.
## Verify this pull request
* Verified by UT cases.
--
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
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #12299: [Improvement][Test] Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299#issuecomment-1274036223
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=12299)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL) [255 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #12299: [Improvement][Test] Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299#issuecomment-1274032882
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=12299)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL) [255 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [dolphinscheduler] EricGao888 merged pull request #12299: [Improvement][Test] Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
Posted by GitBox <gi...@apache.org>.
EricGao888 merged PR #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299
--
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
[GitHub] [dolphinscheduler] kezhenxu94 commented on a diff in pull request #12299: [Improvement][Test] Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299#discussion_r991744636
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sagemaker/src/test/java/org/apache/dolphinscheduler/plugin/task/sagemaker/SagemakerTaskTest.java:
##########
@@ -60,35 +60,37 @@
sagemakerTask.init();
StartPipelineExecutionResult startPipelineExecutionResult = Mockito.mock(StartPipelineExecutionResult.class);
- Mockito.when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+ Mockito.lenient().when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
StopPipelineExecutionResult stopPipelineExecutionResult = Mockito.mock(StopPipelineExecutionResult.class);
- Mockito.when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+ Mockito.lenient().when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
- DescribePipelineExecutionResult describePipelineExecutionResult = Mockito.mock(DescribePipelineExecutionResult.class);
- Mockito.when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing", "Succeeded");
+ DescribePipelineExecutionResult describePipelineExecutionResult =
+ Mockito.mock(DescribePipelineExecutionResult.class);
+ Mockito.lenient().when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing",
+ "Succeeded");
- Mockito.when(client.startPipelineExecution(any())).thenReturn(startPipelineExecutionResult);
- Mockito.when(client.stopPipelineExecution(any())).thenReturn(stopPipelineExecutionResult);
- Mockito.when(client.describePipelineExecution(any())).thenReturn(describePipelineExecutionResult);
+ Mockito.lenient().when(client.startPipelineExecution(any())).thenReturn(startPipelineExecutionResult);
+ Mockito.lenient().when(client.stopPipelineExecution(any())).thenReturn(stopPipelineExecutionResult);
+ Mockito.lenient().when(client.describePipelineExecution(any())).thenReturn(describePipelineExecutionResult);
}
@Test
public void testStartPipelineRequest() throws Exception {
StartPipelineExecutionRequest request = sagemakerTask.createStartPipelineRequest();
- Assert.assertEquals("AbalonePipeline", request.getPipelineName());
- Assert.assertEquals("test Pipeline", request.getPipelineExecutionDescription());
- Assert.assertEquals("AbalonePipeline", request.getPipelineExecutionDisplayName());
- Assert.assertEquals("AbalonePipeline", request.getPipelineName());
- Assert.assertEquals(new Integer(1), request.getParallelismConfiguration().getMaxParallelExecutionSteps());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineName());
+ Assertions.assertEquals("test Pipeline", request.getPipelineExecutionDescription());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineExecutionDisplayName());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineName());
+ Assertions.assertEquals(new Integer(1), request.getParallelismConfiguration().getMaxParallelExecutionSteps());
Review Comment:
@EricGao888 take a look at this
--
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
[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #12299: [Improvement][Test] Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299#discussion_r991763176
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sagemaker/src/test/java/org/apache/dolphinscheduler/plugin/task/sagemaker/SagemakerTaskTest.java:
##########
@@ -60,35 +60,37 @@
sagemakerTask.init();
StartPipelineExecutionResult startPipelineExecutionResult = Mockito.mock(StartPipelineExecutionResult.class);
- Mockito.when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+ Mockito.lenient().when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
StopPipelineExecutionResult stopPipelineExecutionResult = Mockito.mock(StopPipelineExecutionResult.class);
- Mockito.when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+ Mockito.lenient().when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
- DescribePipelineExecutionResult describePipelineExecutionResult = Mockito.mock(DescribePipelineExecutionResult.class);
- Mockito.when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing", "Succeeded");
+ DescribePipelineExecutionResult describePipelineExecutionResult =
+ Mockito.mock(DescribePipelineExecutionResult.class);
+ Mockito.lenient().when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing",
+ "Succeeded");
- Mockito.when(client.startPipelineExecution(any())).thenReturn(startPipelineExecutionResult);
- Mockito.when(client.stopPipelineExecution(any())).thenReturn(stopPipelineExecutionResult);
- Mockito.when(client.describePipelineExecution(any())).thenReturn(describePipelineExecutionResult);
+ Mockito.lenient().when(client.startPipelineExecution(any())).thenReturn(startPipelineExecutionResult);
+ Mockito.lenient().when(client.stopPipelineExecution(any())).thenReturn(stopPipelineExecutionResult);
+ Mockito.lenient().when(client.describePipelineExecution(any())).thenReturn(describePipelineExecutionResult);
}
@Test
public void testStartPipelineRequest() throws Exception {
StartPipelineExecutionRequest request = sagemakerTask.createStartPipelineRequest();
- Assert.assertEquals("AbalonePipeline", request.getPipelineName());
- Assert.assertEquals("test Pipeline", request.getPipelineExecutionDescription());
- Assert.assertEquals("AbalonePipeline", request.getPipelineExecutionDisplayName());
- Assert.assertEquals("AbalonePipeline", request.getPipelineName());
- Assert.assertEquals(new Integer(1), request.getParallelismConfiguration().getMaxParallelExecutionSteps());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineName());
+ Assertions.assertEquals("test Pipeline", request.getPipelineExecutionDescription());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineExecutionDisplayName());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineName());
+ Assertions.assertEquals(new Integer(1), request.getParallelismConfiguration().getMaxParallelExecutionSteps());
Review Comment:
> @EricGao888 take a look at this
@kezhenxu94 Fixed, thanks : )
--
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
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #12299: [Improvement][Test] Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299#issuecomment-1273320589
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=12299)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL) [255 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #12299: [Improvement][Test] Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299#issuecomment-1273317249
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=12299)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL) [255 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=12299&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=12299&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [dolphinscheduler] github-code-scanning[bot] commented on a diff in pull request #12299: [Improvement][Test] Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
Posted by GitBox <gi...@apache.org>.
github-code-scanning[bot] commented on code in PR #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299#discussion_r991263786
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sagemaker/src/test/java/org/apache/dolphinscheduler/plugin/task/sagemaker/SagemakerTaskTest.java:
##########
@@ -60,35 +60,37 @@
sagemakerTask.init();
StartPipelineExecutionResult startPipelineExecutionResult = Mockito.mock(StartPipelineExecutionResult.class);
- Mockito.when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+ Mockito.lenient().when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
StopPipelineExecutionResult stopPipelineExecutionResult = Mockito.mock(StopPipelineExecutionResult.class);
- Mockito.when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+ Mockito.lenient().when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
- DescribePipelineExecutionResult describePipelineExecutionResult = Mockito.mock(DescribePipelineExecutionResult.class);
- Mockito.when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing", "Succeeded");
+ DescribePipelineExecutionResult describePipelineExecutionResult =
+ Mockito.mock(DescribePipelineExecutionResult.class);
+ Mockito.lenient().when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing",
+ "Succeeded");
- Mockito.when(client.startPipelineExecution(any())).thenReturn(startPipelineExecutionResult);
- Mockito.when(client.stopPipelineExecution(any())).thenReturn(stopPipelineExecutionResult);
- Mockito.when(client.describePipelineExecution(any())).thenReturn(describePipelineExecutionResult);
+ Mockito.lenient().when(client.startPipelineExecution(any())).thenReturn(startPipelineExecutionResult);
+ Mockito.lenient().when(client.stopPipelineExecution(any())).thenReturn(stopPipelineExecutionResult);
+ Mockito.lenient().when(client.describePipelineExecution(any())).thenReturn(describePipelineExecutionResult);
}
@Test
public void testStartPipelineRequest() throws Exception {
StartPipelineExecutionRequest request = sagemakerTask.createStartPipelineRequest();
- Assert.assertEquals("AbalonePipeline", request.getPipelineName());
- Assert.assertEquals("test Pipeline", request.getPipelineExecutionDescription());
- Assert.assertEquals("AbalonePipeline", request.getPipelineExecutionDisplayName());
- Assert.assertEquals("AbalonePipeline", request.getPipelineName());
- Assert.assertEquals(new Integer(1), request.getParallelismConfiguration().getMaxParallelExecutionSteps());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineName());
+ Assertions.assertEquals("test Pipeline", request.getPipelineExecutionDescription());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineExecutionDisplayName());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineName());
+ Assertions.assertEquals(new Integer(1), request.getParallelismConfiguration().getMaxParallelExecutionSteps());
Review Comment:
## Deprecated method or constructor invocation
Invoking [Integer.Integer](1) should be avoided because it has been deprecated.
[Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1689)
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-sagemaker/src/test/java/org/apache/dolphinscheduler/plugin/task/sagemaker/SagemakerTaskTest.java:
##########
@@ -60,35 +60,37 @@
sagemakerTask.init();
StartPipelineExecutionResult startPipelineExecutionResult = Mockito.mock(StartPipelineExecutionResult.class);
- Mockito.when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+ Mockito.lenient().when(startPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
StopPipelineExecutionResult stopPipelineExecutionResult = Mockito.mock(StopPipelineExecutionResult.class);
- Mockito.when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
+ Mockito.lenient().when(stopPipelineExecutionResult.getPipelineExecutionArn()).thenReturn(pipelineExecutionArn);
- DescribePipelineExecutionResult describePipelineExecutionResult = Mockito.mock(DescribePipelineExecutionResult.class);
- Mockito.when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing", "Succeeded");
+ DescribePipelineExecutionResult describePipelineExecutionResult =
+ Mockito.mock(DescribePipelineExecutionResult.class);
+ Mockito.lenient().when(describePipelineExecutionResult.getPipelineExecutionStatus()).thenReturn("Executing",
+ "Succeeded");
- Mockito.when(client.startPipelineExecution(any())).thenReturn(startPipelineExecutionResult);
- Mockito.when(client.stopPipelineExecution(any())).thenReturn(stopPipelineExecutionResult);
- Mockito.when(client.describePipelineExecution(any())).thenReturn(describePipelineExecutionResult);
+ Mockito.lenient().when(client.startPipelineExecution(any())).thenReturn(startPipelineExecutionResult);
+ Mockito.lenient().when(client.stopPipelineExecution(any())).thenReturn(stopPipelineExecutionResult);
+ Mockito.lenient().when(client.describePipelineExecution(any())).thenReturn(describePipelineExecutionResult);
}
@Test
public void testStartPipelineRequest() throws Exception {
StartPipelineExecutionRequest request = sagemakerTask.createStartPipelineRequest();
- Assert.assertEquals("AbalonePipeline", request.getPipelineName());
- Assert.assertEquals("test Pipeline", request.getPipelineExecutionDescription());
- Assert.assertEquals("AbalonePipeline", request.getPipelineExecutionDisplayName());
- Assert.assertEquals("AbalonePipeline", request.getPipelineName());
- Assert.assertEquals(new Integer(1), request.getParallelismConfiguration().getMaxParallelExecutionSteps());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineName());
+ Assertions.assertEquals("test Pipeline", request.getPipelineExecutionDescription());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineExecutionDisplayName());
+ Assertions.assertEquals("AbalonePipeline", request.getPipelineName());
+ Assertions.assertEquals(new Integer(1), request.getParallelismConfiguration().getMaxParallelExecutionSteps());
Review Comment:
## Inefficient primitive constructor
Inefficient constructor for int value, use Integer.valueOf(...) instead.
[Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/1690)
--
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
[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #12299: [Improvement][Test] Migrate all UT cases from jUnit4 to jUnit5 in task-plugin module as an example
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #12299:
URL: https://github.com/apache/dolphinscheduler/pull/12299#issuecomment-1273306034
# [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/12299?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#12299](https://codecov.io/gh/apache/dolphinscheduler/pull/12299?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7b1fddf) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/9ab79e064cce90d02adf18343a14d8f7cddc3fae?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9ab79e0) will **increase** coverage by `0.02%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## dev #12299 +/- ##
============================================
+ Coverage 38.53% 38.56% +0.02%
- Complexity 4075 4097 +22
============================================
Files 1023 1031 +8
Lines 38267 38420 +153
Branches 4393 4388 -5
============================================
+ Hits 14748 14817 +69
- Misses 21796 21873 +77
- Partials 1723 1730 +7
```
| [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/12299?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...er/master/dispatch/host/assign/RandomSelector.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9kaXNwYXRjaC9ob3N0L2Fzc2lnbi9SYW5kb21TZWxlY3Rvci5qYXZh) | `77.77% <0.00%> (-5.56%)` | :arrow_down: |
| [...eduler/api/dto/schedule/ScheduleCreateRequest.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2R0by9zY2hlZHVsZS9TY2hlZHVsZUNyZWF0ZVJlcXVlc3QuamF2YQ==) | `83.33% <0.00%> (-2.39%)` | :arrow_down: |
| [...org/apache/dolphinscheduler/remote/utils/Host.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1yZW1vdGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcmVtb3RlL3V0aWxzL0hvc3QuamF2YQ==) | `42.55% <0.00%> (-2.13%)` | :arrow_down: |
| [...e/dolphinscheduler/remote/NettyRemotingClient.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1yZW1vdGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcmVtb3RlL05ldHR5UmVtb3RpbmdDbGllbnQuamF2YQ==) | `51.42% <0.00%> (-1.43%)` | :arrow_down: |
| [...che/dolphinscheduler/common/utils/HadoopUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL0hhZG9vcFV0aWxzLmphdmE=) | `15.94% <0.00%> (-0.73%)` | :arrow_down: |
| [.../apache/dolphinscheduler/common/utils/OSUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL09TVXRpbHMuamF2YQ==) | `34.14% <0.00%> (-0.40%)` | :arrow_down: |
| [...uler/api/service/impl/DataAnalysisServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9EYXRhQW5hbHlzaXNTZXJ2aWNlSW1wbC5qYXZh) | `81.66% <0.00%> (-0.31%)` | :arrow_down: |
| [...heduler/api/service/impl/ResourcesServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9SZXNvdXJjZXNTZXJ2aWNlSW1wbC5qYXZh) | `51.94% <0.00%> (-0.21%)` | :arrow_down: |
| [...pache/dolphinscheduler/common/utils/DateUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL0RhdGVVdGlscy5qYXZh) | `73.91% <0.00%> (-0.17%)` | :arrow_down: |
| [...inscheduler/api/service/impl/UsersServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9Vc2Vyc1NlcnZpY2VJbXBsLmphdmE=) | `70.55% <0.00%> (-0.05%)` | :arrow_down: |
| ... and [22 more](https://codecov.io/gh/apache/dolphinscheduler/pull/12299/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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