|
|
@ -73,6 +73,8 @@ public class DataSourceControllerTest extends AbstractControllerTest { |
|
|
|
paramsMap.put("userName","root"); |
|
|
|
paramsMap.put("userName","root"); |
|
|
|
paramsMap.put("password","123456"); |
|
|
|
paramsMap.put("password","123456"); |
|
|
|
paramsMap.put("other",new HashMap<>()); |
|
|
|
paramsMap.put("other",new HashMap<>()); |
|
|
|
|
|
|
|
paramsMap.put("testFlag",1); |
|
|
|
|
|
|
|
paramsMap.put("bindTestId",null); |
|
|
|
MvcResult mvcResult = mockMvc.perform(post("/datasources") |
|
|
|
MvcResult mvcResult = mockMvc.perform(post("/datasources") |
|
|
|
.header("sessionId", sessionId) |
|
|
|
.header("sessionId", sessionId) |
|
|
|
.contentType(MediaType.APPLICATION_JSON) |
|
|
|
.contentType(MediaType.APPLICATION_JSON) |
|
|
@ -100,6 +102,8 @@ public class DataSourceControllerTest extends AbstractControllerTest { |
|
|
|
paramsMap.put("userName","root"); |
|
|
|
paramsMap.put("userName","root"); |
|
|
|
paramsMap.put("password","root@123"); |
|
|
|
paramsMap.put("password","root@123"); |
|
|
|
paramsMap.put("other",new HashMap<>()); |
|
|
|
paramsMap.put("other",new HashMap<>()); |
|
|
|
|
|
|
|
paramsMap.put("testFlag",0); |
|
|
|
|
|
|
|
paramsMap.put("bindTestId",1); |
|
|
|
MvcResult mvcResult = mockMvc.perform(put("/datasources/2") |
|
|
|
MvcResult mvcResult = mockMvc.perform(put("/datasources/2") |
|
|
|
.header("sessionId", sessionId) |
|
|
|
.header("sessionId", sessionId) |
|
|
|
.content(JSONUtils.toJsonString(paramsMap))) |
|
|
|
.content(JSONUtils.toJsonString(paramsMap))) |
|
|
@ -131,6 +135,7 @@ public class DataSourceControllerTest extends AbstractControllerTest { |
|
|
|
public void testQueryDataSourceList(String key, String dbType) throws Exception { |
|
|
|
public void testQueryDataSourceList(String key, String dbType) throws Exception { |
|
|
|
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>(); |
|
|
|
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>(); |
|
|
|
paramsMap.add(key,dbType); |
|
|
|
paramsMap.add(key,dbType); |
|
|
|
|
|
|
|
paramsMap.add("testFlag", "0"); |
|
|
|
MvcResult mvcResult = mockMvc.perform(get("/datasources/list") |
|
|
|
MvcResult mvcResult = mockMvc.perform(get("/datasources/list") |
|
|
|
.header("sessionId", sessionId) |
|
|
|
.header("sessionId", sessionId) |
|
|
|
.params(paramsMap)) |
|
|
|
.params(paramsMap)) |
|
|
@ -171,6 +176,8 @@ public class DataSourceControllerTest extends AbstractControllerTest { |
|
|
|
paramsMap.put("userName","root"); |
|
|
|
paramsMap.put("userName","root"); |
|
|
|
paramsMap.put("password","123456"); |
|
|
|
paramsMap.put("password","123456"); |
|
|
|
paramsMap.put("other",null); |
|
|
|
paramsMap.put("other",null); |
|
|
|
|
|
|
|
paramsMap.put("testFlag",1); |
|
|
|
|
|
|
|
paramsMap.put("bindTestId",null); |
|
|
|
MvcResult mvcResult = mockMvc.perform(post("/datasources/connect") |
|
|
|
MvcResult mvcResult = mockMvc.perform(post("/datasources/connect") |
|
|
|
.header("sessionId", sessionId) |
|
|
|
.header("sessionId", sessionId) |
|
|
|
.content(JSONUtils.toJsonString(paramsMap))) |
|
|
|
.content(JSONUtils.toJsonString(paramsMap))) |
|
|
|