diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-server/pom.xml b/dolphinscheduler-alert/dolphinscheduler-alert-server/pom.xml
index 587619f9f110e25300cd13ff1fa64abfaf886e7d..b044e948813196492f42aa98b4d03355297f5769 100644
--- a/dolphinscheduler-alert/dolphinscheduler-alert-server/pom.xml
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-server/pom.xml
@@ -26,7 +26,6 @@
dolphinscheduler-alert-server
jar
${project.artifactId}
-
@@ -158,4 +157,5 @@
+
diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-server/src/test/java/org/apache/dolphinscheduler/alert/AlertServerTest.java b/dolphinscheduler-alert/dolphinscheduler-alert-server/src/test/java/org/apache/dolphinscheduler/alert/AlertServerTest.java
index e739ff4d03e719a1310b3e1e10a6603c99824653..63381a2619edd0c4f56efd29f3d4790537c70ca7 100644
--- a/dolphinscheduler-alert/dolphinscheduler-alert-server/src/test/java/org/apache/dolphinscheduler/alert/AlertServerTest.java
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-server/src/test/java/org/apache/dolphinscheduler/alert/AlertServerTest.java
@@ -17,57 +17,53 @@
package org.apache.dolphinscheduler.alert;
-import junit.framework.TestCase;
-import org.apache.dolphinscheduler.dao.AlertDao;
import org.apache.dolphinscheduler.dao.PluginDao;
-import org.apache.dolphinscheduler.dao.entity.Alert;
import org.apache.dolphinscheduler.remote.NettyRemotingServer;
import org.apache.dolphinscheduler.remote.config.NettyServerConfig;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
import org.powermock.reflect.Whitebox;
-import java.util.ArrayList;
-import java.util.List;
+@ExtendWith(MockitoExtension.class)
+public class AlertServerTest {
-
-@RunWith(MockitoJUnitRunner.class)
-public class AlertServerTest extends TestCase {
-
- @InjectMocks
- private AlertServer alertServer;
-
@Mock
private PluginDao pluginDao;
-
+
@Mock
private AlertConfig alertConfig;
@Mock
private AlertSenderService alertSenderService;
-
- @Test
- public void testStart() {
- Mockito.when(pluginDao.checkPluginDefineTableExist()).thenReturn(true);
+ @InjectMocks
+ private AlertServer alertServer;
+
+ @BeforeEach
+ void init() {
+ Mockito.lenient().when(pluginDao.checkPluginDefineTableExist()).thenReturn(true);
- Mockito.when(alertConfig.getPort()).thenReturn(50052);
+ Mockito.lenient().when(alertConfig.getPort()).thenReturn(50052);
Mockito.doNothing().when(alertSenderService).start();
+ }
+ @Test
+ public void alertServerStartSuccessfully() {
+
alertServer.run(null);
-
+
NettyRemotingServer nettyRemotingServer = Whitebox.getInternalState(alertServer, "nettyRemotingServer");
-
+
NettyServerConfig nettyServerConfig = Whitebox.getInternalState(nettyRemotingServer, "serverConfig");
-
- Assert.assertEquals(50052, nettyServerConfig.getListenPort());
+
+ Assertions.assertEquals(50052, nettyServerConfig.getListenPort());
}
}
diff --git a/dolphinscheduler-api/pom.xml b/dolphinscheduler-api/pom.xml
index 6b8fc764f061a3a35478cef8b07d739fcc352af4..efaac0b7d53c57f7a47bbf6feb84832e8e1c7d6f 100644
--- a/dolphinscheduler-api/pom.xml
+++ b/dolphinscheduler-api/pom.xml
@@ -26,7 +26,6 @@
dolphinscheduler-api
jar
${project.artifactId}
-
@@ -38,7 +37,6 @@
-
@@ -158,6 +156,12 @@
test
+
+ org.mockito
+ mockito-core
+ test
+
+
org.apache.curator
curator-test
@@ -192,7 +196,6 @@
test
-
diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceControllerTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceControllerTest.java
index 7090a2f3727e3b18034ccec2d2198e8de6570fc1..b73a21302d8bdd5970adf4627b5179c202579045 100644
--- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceControllerTest.java
+++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceControllerTest.java
@@ -71,9 +71,11 @@ public class TaskInstanceControllerTest extends AbstractControllerTest {
result.setMsg(Status.SUCCESS.getMsg());
when(taskInstanceService.queryTaskListPaging(any(), eq(1L), eq(1), eq(""), eq(""), eq(""), eq(""), any(), any(),
- eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), any(), any())).thenReturn(result);
+ eq(""), Mockito.any(), eq("192.168.xx.xx"), eq(TaskExecuteType.BATCH), any(), any()))
+ .thenReturn(result);
Result taskResult = taskInstanceController.queryTaskListPaging(null, 1L, 1, "", "", "",
- "", "", TaskExecutionStatus.SUCCESS, "192.168.xx.xx", "2020-01-01 00:00:00", "2020-01-02 00:00:00", TaskExecuteType.BATCH, pageNo, pageSize);
+ "", "", TaskExecutionStatus.SUCCESS, "192.168.xx.xx", "2020-01-01 00:00:00", "2020-01-02 00:00:00",
+ TaskExecuteType.BATCH, pageNo, pageSize);
Assert.assertEquals(Integer.valueOf(Status.SUCCESS.getCode()), taskResult.getCode());
}
@@ -91,9 +93,9 @@ public class TaskInstanceControllerTest extends AbstractControllerTest {
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectName}/task-instance/force-success", "cxc_1113")
.header(SESSION_ID, sessionId)
.params(paramsMap))
- .andExpect(status().isOk())
- .andExpect(content().contentType(MediaType.APPLICATION_JSON))
- .andReturn();
+ .andExpect(status().isOk())
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+ .andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(), result.getCode().intValue());
diff --git a/pom.xml b/pom.xml
index 0efadbdb7fa5d8292d831470aeaea19a83ab9860..ef784156f71c4b1f1ed439407645004c13f99895 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,14 +64,15 @@
UTF-8
2.6.1
1.8
- 4.13.1
+ 5.9.0
+ 3.9.0
3.1.12
3.3
3.3.0
2.5.3
2.10.3
2.4
- 2.22.1
+ 3.0.0-M6
3.1.1
3.2.1
2.2.0
@@ -309,6 +310,13 @@
dolphinscheduler-tools
${project.version}
+
+ org.junit
+ junit-bom
+ ${junit.version}
+ pom
+ import
+
@@ -321,9 +329,25 @@
of the submodules.
-->
- junit
- junit
- ${junit.version}
+ org.junit.jupiter
+ junit-jupiter-api
+ test
+
+
+ org.junit.vintage
+ junit-vintage-engine
+ test
+
+
+ org.mockito
+ mockito-core
+ ${mockito.version}
+ test
+
+
+ org.mockito
+ mockito-junit-jupiter
+ ${mockito.version}
test
@@ -581,13 +605,6 @@
${project.build.directory}/jacoco.exec
-
-
- org.apache.maven.surefire
- surefire-junit4
- ${maven-surefire-plugin.version}
-
-