From 955e8ebe0f2389d6bc44dcbc12e02c1b307690c4 Mon Sep 17 00:00:00 2001 From: insist777 <84278047+insist777@users.noreply.github.com> Date: Tue, 20 Sep 2022 15:46:29 +0800 Subject: [PATCH] [Improve] Fix support test tasks UT (#12062) --- .../api/controller/DataSourceControllerTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/DataSourceControllerTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/DataSourceControllerTest.java index a4c0f93f73..d5aa55333c 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/DataSourceControllerTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/DataSourceControllerTest.java @@ -73,6 +73,8 @@ public class DataSourceControllerTest extends AbstractControllerTest { paramsMap.put("userName","root"); paramsMap.put("password","123456"); paramsMap.put("other",new HashMap<>()); + paramsMap.put("testFlag",1); + paramsMap.put("bindTestId",null); MvcResult mvcResult = mockMvc.perform(post("/datasources") .header("sessionId", sessionId) .contentType(MediaType.APPLICATION_JSON) @@ -100,6 +102,8 @@ public class DataSourceControllerTest extends AbstractControllerTest { paramsMap.put("userName","root"); paramsMap.put("password","root@123"); paramsMap.put("other",new HashMap<>()); + paramsMap.put("testFlag",0); + paramsMap.put("bindTestId",1); MvcResult mvcResult = mockMvc.perform(put("/datasources/2") .header("sessionId", sessionId) .content(JSONUtils.toJsonString(paramsMap))) @@ -131,6 +135,7 @@ public class DataSourceControllerTest extends AbstractControllerTest { public void testQueryDataSourceList(String key, String dbType) throws Exception { MultiValueMap paramsMap = new LinkedMultiValueMap<>(); paramsMap.add(key,dbType); + paramsMap.add("testFlag", "0"); MvcResult mvcResult = mockMvc.perform(get("/datasources/list") .header("sessionId", sessionId) .params(paramsMap)) @@ -171,6 +176,8 @@ public class DataSourceControllerTest extends AbstractControllerTest { paramsMap.put("userName","root"); paramsMap.put("password","123456"); paramsMap.put("other",null); + paramsMap.put("testFlag",1); + paramsMap.put("bindTestId",null); MvcResult mvcResult = mockMvc.perform(post("/datasources/connect") .header("sessionId", sessionId) .content(JSONUtils.toJsonString(paramsMap)))