Browse Source

[Improve] Fix support test tasks UT (#12062)

3.2.0-release
insist777 2 years ago committed by GitHub
parent
commit
955e8ebe0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/DataSourceControllerTest.java

7
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<String, String> 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)))

Loading…
Cancel
Save