This is an automated email from the ASF dual-hosted git repository.

peacewong pushed a commit to branch dev-1.3.2
in repository https://gitbox.apache.org/repos/asf/linkis.git


The following commit(s) were added to refs/heads/dev-1.3.2 by this push:
     new 26d312eb3 feat:Add unit tests for the basic data management (#4038)
26d312eb3 is described below

commit 26d312eb306058bf3f94160f41cd15f9e065016c
Author: jacktao007 <[email protected]>
AuthorDate: Fri Feb 10 23:10:57 2023 +0800

    feat:Add unit tests for the basic data management (#4038)
    
    * feat:Add unit tests for the basic data management
---
 .../apache/linkis/basedatamanager/server/Scan.java |  26 ++++
 .../server/WebApplicationServer.java               |  34 +++++
 .../basedatamanager/server/dao/BaseDaoTest.java    |  31 ++++
 .../server/dao/DatasourceAccessMapperTest.java     |  48 ++++++
 .../restful/DatasourceAccessRestfulApiTest.java    | 149 +++++++++++++++++++
 .../restful/DatasourceEnvRestfulApiTest.java       | 138 ++++++++++++++++++
 .../restful/DatasourceTypeKeyRestfulApiTest.java   | 158 ++++++++++++++++++++
 .../restful/DatasourceTypeRestfulApiTest.java      | 159 ++++++++++++++++++++
 .../server/restful/ErrorCodeRestfulApiTest.java    | 154 ++++++++++++++++++++
 .../restful/GatewayAuthTokenRestfulApiTest.java    | 161 +++++++++++++++++++++
 .../basedatamanager/server/restful/MvcUtils.java   | 126 ++++++++++++++++
 .../RmExternalResourceProviderRestfulApiTest.java  | 154 ++++++++++++++++++++
 .../server/restful/UdfManagerRestfulApiTest.java   | 151 +++++++++++++++++++
 .../server/restful/UdfTreeRestfulApiTest.java      | 159 ++++++++++++++++++++
 .../service/DatasourceAccessServiceTest.java       |  63 ++++++++
 .../server/service/DatasourceEnvServiceTest.java   |  65 +++++++++
 .../service/DatasourceTypeKeyServiceTest.java      |  65 +++++++++
 .../server/service/DatasourceTypeServiceTest.java  |  64 ++++++++
 .../server/service/ErrorCodeServiceTest.java       |  63 ++++++++
 .../service/GatewayAuthTokenServiceTest.java       |  63 ++++++++
 .../RmExternalResourceProviderServiceTest.java     |  60 ++++++++
 .../server/service/UdfManagerServiceTest.java      |  43 ++++++
 .../server/service/UdfTreeServiceTest.java         |  60 ++++++++
 .../src/test/resources/application.properties      |  63 ++++++++
 .../src/test/resources/create.sql                  | 145 +++++++++++++++++++
 .../src/test/resources/data.sql                    |  45 ++++++
 .../src/test/resources/linkis.properties           |  21 +++
 27 files changed, 2468 insertions(+)

diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/Scan.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/Scan.java
new file mode 100644
index 000000000..fb91c8f4b
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/Scan.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server;
+
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+
+import org.mybatis.spring.annotation.MapperScan;
+
+@EnableAutoConfiguration
+@MapperScan("org.apache.linkis.basedatamanager.server.dao")
+public class Scan {}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/WebApplicationServer.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/WebApplicationServer.java
new file mode 100644
index 000000000..8a61c21d8
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/WebApplicationServer.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server;
+
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import 
org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+import org.springframework.context.annotation.ComponentScan;
+
+@EnableAutoConfiguration
+@ServletComponentScan
+@ComponentScan
+public class WebApplicationServer extends SpringBootServletInitializer {
+
+  public static void main(String[] args) {
+    new SpringApplicationBuilder(WebApplicationServer.class).run(args);
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/dao/BaseDaoTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/dao/BaseDaoTest.java
new file mode 100644
index 000000000..bf0b5e2fd
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/dao/BaseDaoTest.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.dao;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.annotation.Rollback;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.springframework.transaction.annotation.Transactional;
+
+@SpringBootTest(classes = Scan.class)
+@Transactional
+@Rollback()
+@EnableTransactionManagement
+public abstract class BaseDaoTest {}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/dao/DatasourceAccessMapperTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/dao/DatasourceAccessMapperTest.java
new file mode 100644
index 000000000..8d4a5435e
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/dao/DatasourceAccessMapperTest.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.dao;
+
+import org.apache.linkis.basedatamanager.server.domain.DatasourceAccessEntity;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.Date;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class DatasourceAccessMapperTest extends BaseDaoTest {
+  @Autowired DatasourceAccessMapper datasourceAccessMapper;
+
+  private DatasourceAccessEntity insertDatasourceAccessMapper() {
+    DatasourceAccessEntity datasourceAccessEntity = new 
DatasourceAccessEntity();
+    datasourceAccessEntity.setId(1L);
+    datasourceAccessEntity.setAccessTime(new Date());
+    datasourceAccessEntity.setFields("test");
+    datasourceAccessEntity.setTableId(10L);
+    datasourceAccessEntity.setApplicationId(22);
+    return datasourceAccessEntity;
+  }
+
+  @Test
+  void testInsertValue() {
+    DatasourceAccessEntity result = insertDatasourceAccessMapper();
+    assertTrue(result.getId() > 0);
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceAccessRestfulApiTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceAccessRestfulApiTest.java
new file mode 100644
index 000000000..f6805bfd3
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceAccessRestfulApiTest.java
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceEnvEntity;
+import 
org.apache.linkis.basedatamanager.server.service.DatasourceAccessService;
+import org.apache.linkis.server.Message;
+import org.apache.linkis.server.MessageStatus;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.Mock;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+@ExtendWith({SpringExtension.class})
+@AutoConfigureMockMvc
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class DatasourceAccessRestfulApiTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceAccessRestfulApiTest.class);
+
+  @Autowired protected MockMvc mockMvc;
+
+  @Mock private DatasourceAccessService datasourceAccessService;
+
+  @Test
+  public void TestList() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    paramsMap.add("searchName", "");
+    paramsMap.add("currentPage", "1");
+    paramsMap.add("pageSize", "10");
+    String url = "/basedata-manager/datasource-env";
+    sendUrl(url, paramsMap, "get", null);
+  }
+
+  @Test
+  public void TestGet() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/datasource-env/" + "1";
+    sendUrl(url, paramsMap, "get", null);
+  }
+
+  @Test
+  public void TestAdd() throws Exception {
+    String url = "/basedata-manager/datasource-env";
+    DatasourceEnvEntity datasourceEnv = new DatasourceEnvEntity();
+    datasourceEnv.setId(2);
+    datasourceEnv.setEnvName("test");
+    datasourceEnv.setEnvDesc("test");
+    datasourceEnv.setParameter("params");
+    datasourceEnv.setCreateTime(new Date());
+    datasourceEnv.setModifyTime(new Date());
+    datasourceEnv.setDatasourceTypeId(1);
+    datasourceEnv.setModifyUser("linkis");
+    datasourceEnv.setCreateUser("linkis");
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(datasourceEnv);
+    sendUrl(url, null, "post", msg);
+  }
+
+  @Test
+  public void TestUpdate() throws Exception {
+    String url = "/basedata-manager/datasource-env";
+    DatasourceEnvEntity datasourceEnv = new DatasourceEnvEntity();
+    datasourceEnv.setId(2);
+    datasourceEnv.setEnvName("test");
+    datasourceEnv.setEnvDesc("test");
+    datasourceEnv.setParameter("params");
+    datasourceEnv.setCreateTime(new Date());
+    datasourceEnv.setModifyTime(new Date());
+    datasourceEnv.setDatasourceTypeId(1);
+    datasourceEnv.setModifyUser("linkis");
+    datasourceEnv.setCreateUser("linkis");
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(datasourceEnv);
+    sendUrl(url, null, "put", msg);
+  }
+
+  @Test
+  public void TestRemove() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/datasource-env/" + "1";
+    sendUrl(url, paramsMap, "delete", null);
+  }
+
+  public void sendUrl(String url, MultiValueMap<String, String> paramsMap, 
String type, String msg)
+      throws Exception {
+    MvcUtils mvcUtils = new MvcUtils(mockMvc);
+    Message mvcResult = null;
+    if (type.equals("get")) {
+      if (paramsMap != null) {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultGet(url, 
paramsMap));
+      } else {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultGet(url));
+      }
+    }
+
+    if (type.equals("delete")) {
+      mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultDelete(url));
+    }
+
+    if (type.equals("post")) {
+      if (msg != null) {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPost(url, msg));
+      } else {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPost(url));
+      }
+    }
+    if (type.equals("put")) {
+      if (msg != null) {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPut(url, msg));
+      } else {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPut(url));
+      }
+    }
+    assertEquals(MessageStatus.SUCCESS(), mvcResult.getStatus());
+    logger.info(String.valueOf(mvcResult));
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceEnvRestfulApiTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceEnvRestfulApiTest.java
new file mode 100644
index 000000000..5d3bb2413
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceEnvRestfulApiTest.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceAccessEntity;
+import org.apache.linkis.server.Message;
+import org.apache.linkis.server.MessageStatus;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+@ExtendWith({SpringExtension.class})
+@AutoConfigureMockMvc
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class DatasourceEnvRestfulApiTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceAccessRestfulApiTest.class);
+
+  @Autowired protected MockMvc mockMvc;
+
+  @Test
+  public void TestList() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    paramsMap.add("searchName", "");
+    paramsMap.add("currentPage", "1");
+    paramsMap.add("pageSize", "10");
+    String url = "/basedata-manager/datasource-access";
+    sendUrl(url, paramsMap, "get", null);
+  }
+
+  @Test
+  public void TestGet() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/datasource-access/" + "1";
+    sendUrl(url, paramsMap, "get", null);
+  }
+
+  @Test
+  public void TestAdd() throws Exception {
+    String url = "/basedata-manager/datasource-access";
+    DatasourceAccessEntity datasourceAccessEntity = new 
DatasourceAccessEntity();
+    datasourceAccessEntity.setApplicationId(1);
+    datasourceAccessEntity.setTableId(1L);
+    datasourceAccessEntity.setVisitor("1");
+    datasourceAccessEntity.setFields("1");
+    datasourceAccessEntity.setAccessTime(new Date());
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(datasourceAccessEntity);
+    sendUrl(url, null, "post", msg);
+  }
+
+  @Test
+  public void TestUpdate() throws Exception {
+    String url = "/basedata-manager/datasource-access";
+    DatasourceAccessEntity datasourceAccessEntity = new 
DatasourceAccessEntity();
+    datasourceAccessEntity.setId(1L);
+    datasourceAccessEntity.setApplicationId(1);
+    datasourceAccessEntity.setTableId(1L);
+    datasourceAccessEntity.setVisitor("1");
+    datasourceAccessEntity.setFields("1");
+    datasourceAccessEntity.setAccessTime(new Date());
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(datasourceAccessEntity);
+    sendUrl(url, null, "put", msg);
+  }
+
+  @Test
+  public void TestRemove() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/datasource-access/" + "1";
+    sendUrl(url, paramsMap, "delete", null);
+  }
+
+  public void sendUrl(String url, MultiValueMap<String, String> paramsMap, 
String type, String msg)
+      throws Exception {
+    MvcUtils mvcUtils = new MvcUtils(mockMvc);
+    Message mvcResult = null;
+    if (type.equals("get")) {
+      if (paramsMap != null) {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultGet(url, 
paramsMap));
+      } else {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultGet(url));
+      }
+    }
+
+    if (type.equals("delete")) {
+      mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultDelete(url));
+    }
+
+    if (type.equals("post")) {
+      if (msg != null) {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPost(url, msg));
+      } else {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPost(url));
+      }
+    }
+    if (type.equals("put")) {
+      if (msg != null) {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPut(url, msg));
+      } else {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPut(url));
+      }
+    }
+    assertEquals(MessageStatus.SUCCESS(), mvcResult.getStatus());
+    logger.info(String.valueOf(mvcResult));
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceTypeKeyRestfulApiTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceTypeKeyRestfulApiTest.java
new file mode 100644
index 000000000..e4ad07257
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceTypeKeyRestfulApiTest.java
@@ -0,0 +1,158 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceTypeKeyEntity;
+import org.apache.linkis.server.Message;
+import org.apache.linkis.server.MessageStatus;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+@ExtendWith({SpringExtension.class})
+@AutoConfigureMockMvc
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class DatasourceTypeKeyRestfulApiTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceAccessRestfulApiTest.class);
+
+  @Autowired protected MockMvc mockMvc;
+
+  private static DatasourceTypeKeyEntity datasourceTypeKeyEntity;
+
+  @BeforeAll
+  public static void setup() {
+    datasourceTypeKeyEntity = new DatasourceTypeKeyEntity();
+    datasourceTypeKeyEntity.setId(0);
+    datasourceTypeKeyEntity.setDataSourceTypeId(0);
+    datasourceTypeKeyEntity.setKey("test");
+    datasourceTypeKeyEntity.setName("test");
+    datasourceTypeKeyEntity.setNameEn("test");
+    datasourceTypeKeyEntity.setDefaultValue("test");
+    datasourceTypeKeyEntity.setValueType("test");
+    datasourceTypeKeyEntity.setScope("test");
+    datasourceTypeKeyEntity.setRequire(0);
+    datasourceTypeKeyEntity.setDescription("test");
+    datasourceTypeKeyEntity.setDescriptionEn("test");
+    datasourceTypeKeyEntity.setValueRegex("test");
+    datasourceTypeKeyEntity.setRefId(0L);
+    datasourceTypeKeyEntity.setRefValue("test");
+    datasourceTypeKeyEntity.setDataSource("test");
+    datasourceTypeKeyEntity.setUpdateTime(new Date());
+    datasourceTypeKeyEntity.setCreateTime(new Date());
+  }
+
+  @Test
+  public void TestDemo() throws JsonProcessingException {
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(datasourceTypeKeyEntity);
+    System.out.println(msg);
+  }
+
+  @Test
+  public void TestList() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    paramsMap.add("searchName", "");
+    paramsMap.add("currentPage", "1");
+    paramsMap.add("pageSize", "10");
+    String url = "/basedata-manager/datasource-type-key";
+    sendUrl(url, paramsMap, "get", null);
+  }
+
+  @Test
+  public void TestGet() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/datasource-type-key/" + "1";
+    sendUrl(url, paramsMap, "get", null);
+  }
+
+  @Test
+  public void TestAdd() throws Exception {
+    String url = "/basedata-manager/datasource-type-key";
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(datasourceTypeKeyEntity);
+    sendUrl(url, null, "post", msg);
+  }
+
+  @Test
+  public void TestUpdate() throws Exception {
+    String url = "/basedata-manager/datasource-type-key";
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(datasourceTypeKeyEntity);
+    sendUrl(url, null, "put", msg);
+  }
+
+  @Test
+  public void TestRemove() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/datasource-type-key/" + "1";
+    sendUrl(url, paramsMap, "delete", null);
+  }
+
+  public void sendUrl(String url, MultiValueMap<String, String> paramsMap, 
String type, String msg)
+      throws Exception {
+    MvcUtils mvcUtils = new MvcUtils(mockMvc);
+    Message mvcResult = null;
+    if (type.equals("get")) {
+      if (paramsMap != null) {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultGet(url, 
paramsMap));
+      } else {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultGet(url));
+      }
+    }
+
+    if (type.equals("delete")) {
+      mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultDelete(url));
+    }
+
+    if (type.equals("post")) {
+      if (msg != null) {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPost(url, msg));
+      } else {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPost(url));
+      }
+    }
+    if (type.equals("put")) {
+      if (msg != null) {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPut(url, msg));
+      } else {
+        mvcResult = mvcUtils.getMessage(mvcUtils.buildMvcResultPut(url));
+      }
+    }
+    assertEquals(MessageStatus.SUCCESS(), mvcResult.getStatus());
+    logger.info(String.valueOf(mvcResult));
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceTypeRestfulApiTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceTypeRestfulApiTest.java
new file mode 100644
index 000000000..7f25855ea
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/DatasourceTypeRestfulApiTest.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceTypeEntity;
+import org.apache.linkis.common.utils.JsonUtils;
+import org.apache.linkis.server.Message;
+import org.apache.linkis.server.MessageStatus;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.MvcResult;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith({SpringExtension.class})
+@AutoConfigureMockMvc
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class DatasourceTypeRestfulApiTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceTypeRestfulApiTest.class);
+
+  @Autowired protected MockMvc mockMvc;
+
+  @Test
+  public void TestList() throws Exception {
+    LinkedMultiValueMap<String, String> paramsMap = new 
LinkedMultiValueMap<>();
+    paramsMap.add("searchName", "");
+    paramsMap.add("currentPage", "1");
+    paramsMap.add("pageSize", "10");
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                
MockMvcRequestBuilders.get("/basedata-manager/datasource-type").params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestGet() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/datasource-type/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get(url).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestAdd() throws Exception {
+    String url = "/basedata-manager/datasource-type";
+    ObjectMapper objectMapper = new ObjectMapper();
+    DatasourceTypeEntity datasourceTypeEntity = new DatasourceTypeEntity();
+    datasourceTypeEntity.setId(10);
+    datasourceTypeEntity.setName("test");
+    datasourceTypeEntity.setClassifier("test");
+    datasourceTypeEntity.setDescription("test");
+    datasourceTypeEntity.setIcon("test");
+    datasourceTypeEntity.setLayers(1);
+    datasourceTypeEntity.setOption("test");
+    String msg = objectMapper.writeValueAsString(datasourceTypeEntity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.post(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestUpdate() throws Exception {
+    String url = "/basedata-manager/datasource-type";
+    ObjectMapper objectMapper = new ObjectMapper();
+    DatasourceTypeEntity datasourceTypeEntity = new DatasourceTypeEntity();
+    datasourceTypeEntity.setId(10);
+    datasourceTypeEntity.setName("test");
+    datasourceTypeEntity.setClassifier("test");
+    datasourceTypeEntity.setDescription("test");
+    datasourceTypeEntity.setIcon("test");
+    datasourceTypeEntity.setLayers(1);
+    datasourceTypeEntity.setOption("test");
+    String msg = objectMapper.writeValueAsString(datasourceTypeEntity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.put(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestRemove() throws Exception {
+    String url = "/basedata-manager/datasource-type/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.delete(url))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/ErrorCodeRestfulApiTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/ErrorCodeRestfulApiTest.java
new file mode 100644
index 000000000..38708e801
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/ErrorCodeRestfulApiTest.java
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+import org.apache.linkis.basedatamanager.server.domain.ErrorCodeEntity;
+import org.apache.linkis.common.utils.JsonUtils;
+import org.apache.linkis.server.Message;
+import org.apache.linkis.server.MessageStatus;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.MvcResult;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith({SpringExtension.class})
+@AutoConfigureMockMvc
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class ErrorCodeRestfulApiTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceTypeRestfulApiTest.class);
+
+  @Autowired protected MockMvc mockMvc;
+
+  @Test
+  public void TestList() throws Exception {
+    LinkedMultiValueMap<String, String> paramsMap = new 
LinkedMultiValueMap<>();
+    paramsMap.add("searchName", "");
+    paramsMap.add("currentPage", "1");
+    paramsMap.add("pageSize", "10");
+    MvcResult mvcResult =
+        mockMvc
+            
.perform(MockMvcRequestBuilders.get("/basedata-manager/error-code").params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestGet() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/error-code/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get(url).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestAdd() throws Exception {
+    String url = "/basedata-manager/error-code";
+    ObjectMapper objectMapper = new ObjectMapper();
+    ErrorCodeEntity errorCodeEntity = new ErrorCodeEntity();
+    errorCodeEntity.setId(10L);
+    errorCodeEntity.setErrorCode("test");
+    errorCodeEntity.setErrorRegex("test");
+    errorCodeEntity.setErrorType(1);
+    errorCodeEntity.setErrorDesc("test");
+    String msg = objectMapper.writeValueAsString(errorCodeEntity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.post(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestUpdate() throws Exception {
+    String url = "/basedata-manager/error-code";
+    ObjectMapper objectMapper = new ObjectMapper();
+    ErrorCodeEntity errorCodeEntity = new ErrorCodeEntity();
+    errorCodeEntity.setId(10L);
+    errorCodeEntity.setErrorCode("test");
+    errorCodeEntity.setErrorRegex("test");
+    errorCodeEntity.setErrorType(1);
+    errorCodeEntity.setErrorDesc("test");
+    String msg = objectMapper.writeValueAsString(errorCodeEntity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.put(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestRemove() throws Exception {
+    String url = "/basedata-manager/error-code/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.delete(url))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/GatewayAuthTokenRestfulApiTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/GatewayAuthTokenRestfulApiTest.java
new file mode 100644
index 000000000..9ffa15d28
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/GatewayAuthTokenRestfulApiTest.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+import org.apache.linkis.basedatamanager.server.domain.GatewayAuthTokenEntity;
+import org.apache.linkis.common.utils.JsonUtils;
+import org.apache.linkis.server.Message;
+import org.apache.linkis.server.MessageStatus;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.MvcResult;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith({SpringExtension.class})
+@AutoConfigureMockMvc
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class GatewayAuthTokenRestfulApiTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceTypeRestfulApiTest.class);
+  private String module = "gateway-auth-token";
+  private GatewayAuthTokenEntity entity;
+  @Autowired protected MockMvc mockMvc;
+
+  @BeforeEach
+  public void setup() {
+    entity = new GatewayAuthTokenEntity();
+    entity.setId(2);
+    entity.setBusinessOwner("test");
+    entity.setElapseDay(1L);
+    entity.setBusinessOwner("test");
+    entity.setUpdateBy("test");
+    entity.setLegalHosts("*");
+    entity.setLegalUsers("*");
+    entity.setTokenName("test");
+    entity.setCreateTime(new Date());
+    entity.setUpdateTime(new Date());
+  }
+
+  @Test
+  public void TestList() throws Exception {
+    LinkedMultiValueMap<String, String> paramsMap = new 
LinkedMultiValueMap<>();
+    paramsMap.add("searchName", "");
+    paramsMap.add("currentPage", "1");
+    paramsMap.add("pageSize", "10");
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get("/basedata-manager/" + 
module).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestGet() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/" + module + "/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get(url).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestAdd() throws Exception {
+    String url = "/basedata-manager/" + module;
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(entity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.post(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestUpdate() throws Exception {
+    String url = "/basedata-manager/" + module;
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(entity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.put(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestRemove() throws Exception {
+    String url = "/basedata-manager/" + module + "/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.delete(url))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/MvcUtils.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/MvcUtils.java
new file mode 100644
index 000000000..1b642ad31
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/MvcUtils.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.common.utils.JsonUtils;
+import org.apache.linkis.server.Message;
+
+import org.springframework.http.MediaType;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.MvcResult;
+import org.springframework.util.MultiValueMap;
+
+import static 
org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
+import static 
org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static 
org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+public class MvcUtils {
+  private MockMvc mockMvc;
+
+  public MvcUtils(MockMvc mockMvc) {
+    this.mockMvc = mockMvc;
+  }
+
+  public MvcResult buildMvcResultGet(String url) throws Exception {
+    MvcResult mvcResult =
+        mockMvc
+            .perform(get(url))
+            .andExpect(status().isOk())
+            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    return mvcResult;
+  }
+
+  public MvcResult buildMvcResultGet(String url, MultiValueMap<String, String> 
params)
+      throws Exception {
+    MvcResult mvcResult =
+        mockMvc
+            .perform(get(url).params(params))
+            .andExpect(status().isOk())
+            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    return mvcResult;
+  }
+
+  public MvcResult buildMvcResultPost(String url, String json) throws 
Exception {
+    MvcResult mvcResult =
+        mockMvc
+            
.perform(post(url).contentType(MediaType.APPLICATION_JSON).content(json))
+            .andExpect(status().isOk())
+            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    return mvcResult;
+  }
+
+  public MvcResult buildMvcResultPost(String url) throws Exception {
+    MvcResult mvcResult =
+        mockMvc
+            .perform(post(url))
+            .andExpect(status().isOk())
+            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    return mvcResult;
+  }
+
+  public MvcResult buildMvcResultPost(String url, MultiValueMap<String, 
String> params)
+      throws Exception {
+    MvcResult mvcResult =
+        mockMvc
+            .perform(post(url, params))
+            .andExpect(status().isOk())
+            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    return mvcResult;
+  }
+
+  public MvcResult buildMvcResultPut(String url, String json) throws Exception 
{
+    MvcResult mvcResult =
+        mockMvc
+            
.perform(put(url).contentType(MediaType.APPLICATION_JSON).content(json))
+            .andExpect(status().isOk())
+            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    return mvcResult;
+  }
+
+  public MvcResult buildMvcResultPut(String url) throws Exception {
+    MvcResult mvcResult =
+        mockMvc
+            .perform(put(url))
+            .andExpect(status().isOk())
+            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    return mvcResult;
+  }
+
+  public MvcResult buildMvcResultDelete(String url) throws Exception {
+    MvcResult mvcResult =
+        mockMvc
+            .perform(delete(url))
+            .andExpect(status().isOk())
+            .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    return mvcResult;
+  }
+
+  public Message getMessage(MvcResult mvcResult) throws Exception {
+    Message res =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    return res;
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/RmExternalResourceProviderRestfulApiTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/RmExternalResourceProviderRestfulApiTest.java
new file mode 100644
index 000000000..e94ee8068
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/RmExternalResourceProviderRestfulApiTest.java
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+import 
org.apache.linkis.basedatamanager.server.domain.RmExternalResourceProviderEntity;
+import org.apache.linkis.common.utils.JsonUtils;
+import org.apache.linkis.server.Message;
+import org.apache.linkis.server.MessageStatus;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.MvcResult;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith({SpringExtension.class})
+@AutoConfigureMockMvc
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class RmExternalResourceProviderRestfulApiTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceTypeRestfulApiTest.class);
+  private String module = "rm-external-resource-provider";
+  private RmExternalResourceProviderEntity entity;
+  @Autowired protected MockMvc mockMvc;
+
+  @BeforeEach
+  public void setup() {
+    entity = new RmExternalResourceProviderEntity();
+    entity.setId(2);
+    entity.setConfig("test");
+    entity.setLabels("test");
+    entity.setName("test");
+    entity.setResourceType("test");
+  }
+
+  @Test
+  public void TestList() throws Exception {
+    LinkedMultiValueMap<String, String> paramsMap = new 
LinkedMultiValueMap<>();
+    paramsMap.add("searchName", "");
+    paramsMap.add("currentPage", "1");
+    paramsMap.add("pageSize", "10");
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get("/basedata-manager/" + 
module).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestGet() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/" + module + "/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get(url).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestAdd() throws Exception {
+    String url = "/basedata-manager/" + module;
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(entity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.post(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestUpdate() throws Exception {
+    String url = "/basedata-manager/" + module;
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(entity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.put(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestRemove() throws Exception {
+    String url = "/basedata-manager/" + module + "/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.delete(url))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/UdfManagerRestfulApiTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/UdfManagerRestfulApiTest.java
new file mode 100644
index 000000000..34891cc18
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/UdfManagerRestfulApiTest.java
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+import org.apache.linkis.basedatamanager.server.domain.UdfManagerEntity;
+import org.apache.linkis.common.utils.JsonUtils;
+import org.apache.linkis.server.Message;
+import org.apache.linkis.server.MessageStatus;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.MvcResult;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith({SpringExtension.class})
+@AutoConfigureMockMvc
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class UdfManagerRestfulApiTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceTypeRestfulApiTest.class);
+  private String module = "udf-manager";
+  private UdfManagerEntity entity;
+  @Autowired protected MockMvc mockMvc;
+
+  @BeforeEach
+  public void setup() {
+    entity = new UdfManagerEntity();
+    entity.setId(2L);
+    entity.setUserName("test");
+  }
+
+  @Test
+  public void TestList() throws Exception {
+    LinkedMultiValueMap<String, String> paramsMap = new 
LinkedMultiValueMap<>();
+    paramsMap.add("searchName", "");
+    paramsMap.add("currentPage", "1");
+    paramsMap.add("pageSize", "10");
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get("/basedata-manager/" + 
module).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestGet() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/" + module + "/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get(url).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestAdd() throws Exception {
+    String url = "/basedata-manager/" + module;
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(entity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.post(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestUpdate() throws Exception {
+    String url = "/basedata-manager/" + module;
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(entity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.put(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestRemove() throws Exception {
+    String url = "/basedata-manager/" + module + "/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.delete(url))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/UdfTreeRestfulApiTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/UdfTreeRestfulApiTest.java
new file mode 100644
index 000000000..88dd6e6bb
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/restful/UdfTreeRestfulApiTest.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.restful;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+import org.apache.linkis.basedatamanager.server.domain.UdfTreeEntity;
+import org.apache.linkis.common.utils.JsonUtils;
+import org.apache.linkis.server.Message;
+import org.apache.linkis.server.MessageStatus;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import 
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.http.MediaType;
+import org.springframework.test.context.junit.jupiter.SpringExtension;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.MvcResult;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith({SpringExtension.class})
+@AutoConfigureMockMvc
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class UdfTreeRestfulApiTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceTypeRestfulApiTest.class);
+  private String module = "udf-tree";
+  private UdfTreeEntity entity;
+  @Autowired protected MockMvc mockMvc;
+
+  @BeforeEach
+  public void setup() {
+    entity = new UdfTreeEntity();
+    entity.setId(2L);
+    entity.setUserName("test");
+    entity.setCreateTime(new Date());
+    entity.setUpdateTime(new Date());
+    entity.setName("test");
+    entity.setCategory("test");
+    entity.setDescription("test");
+    entity.setParent(1L);
+  }
+
+  @Test
+  public void TestList() throws Exception {
+    LinkedMultiValueMap<String, String> paramsMap = new 
LinkedMultiValueMap<>();
+    paramsMap.add("searchName", "");
+    paramsMap.add("currentPage", "1");
+    paramsMap.add("pageSize", "10");
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get("/basedata-manager/" + 
module).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestGet() throws Exception {
+    MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+    String url = "/basedata-manager/" + module + "/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.get(url).params(paramsMap))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestAdd() throws Exception {
+    String url = "/basedata-manager/" + module;
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(entity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.post(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestUpdate() throws Exception {
+    String url = "/basedata-manager/" + module;
+    ObjectMapper objectMapper = new ObjectMapper();
+    String msg = objectMapper.writeValueAsString(entity);
+    MvcResult mvcResult =
+        mockMvc
+            .perform(
+                MockMvcRequestBuilders.put(url)
+                    .contentType(MediaType.APPLICATION_JSON)
+                    .content(msg))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+
+  @Test
+  public void TestRemove() throws Exception {
+    String url = "/basedata-manager/" + module + "/" + "1";
+    MvcResult mvcResult =
+        mockMvc
+            .perform(MockMvcRequestBuilders.delete(url))
+            .andExpect(MockMvcResultMatchers.status().isOk())
+            
.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))
+            .andReturn();
+    Message message =
+        
JsonUtils.jackson().readValue(mvcResult.getResponse().getContentAsString(), 
Message.class);
+    Assertions.assertEquals(MessageStatus.SUCCESS(), message.getStatus());
+    logger.info(String.valueOf(message));
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceAccessServiceTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceAccessServiceTest.java
new file mode 100644
index 000000000..7eb89db68
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceAccessServiceTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.service;
+
+import org.apache.linkis.basedatamanager.server.dao.DatasourceAccessMapper;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceAccessEntity;
+import 
org.apache.linkis.basedatamanager.server.service.impl.DatasourceAccessServiceImpl;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import com.github.pagehelper.PageInfo;
+import org.junit.jupiter.api.Assertions;
+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.junit.jupiter.MockitoExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith(MockitoExtension.class)
+class DatasourceAccessServiceTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceAccessServiceTest.class);
+
+  @InjectMocks private DatasourceAccessServiceImpl datasourceAccessService;
+
+  @Mock private DatasourceAccessMapper datasourceAccessMapper;
+
+  @Test
+  void getListByPageTest() {
+    ArrayList<DatasourceAccessEntity> t = new ArrayList<>();
+    DatasourceAccessEntity datasourceAccessEntity = new 
DatasourceAccessEntity();
+    datasourceAccessEntity.setId(0L);
+    datasourceAccessEntity.setTableId(0L);
+    datasourceAccessEntity.setVisitor("test");
+    datasourceAccessEntity.setFields("test");
+    datasourceAccessEntity.setApplicationId(0);
+    datasourceAccessEntity.setAccessTime(new Date());
+
+    t.add(datasourceAccessEntity);
+    Mockito.when(datasourceAccessMapper.getListByPage("")).thenReturn(t);
+    PageInfo listByPage = datasourceAccessService.getListByPage("", 1, 1);
+    Assertions.assertTrue(listByPage.getSize() > 0);
+    logger.info(listByPage.toString());
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceEnvServiceTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceEnvServiceTest.java
new file mode 100644
index 000000000..c5fb5acd6
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceEnvServiceTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.service;
+
+import org.apache.linkis.basedatamanager.server.dao.DatasourceEnvMapper;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceEnvEntity;
+import 
org.apache.linkis.basedatamanager.server.service.impl.DatasourceEnvServiceImpl;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import com.github.pagehelper.PageInfo;
+import org.junit.jupiter.api.Assertions;
+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.junit.jupiter.MockitoExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith(MockitoExtension.class)
+class DatasourceEnvServiceTest {
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceEnvServiceTest.class);
+
+  @InjectMocks private DatasourceEnvServiceImpl datasourceEnvService;
+
+  @Mock private DatasourceEnvMapper datasourceEnvMapper;
+
+  @Test
+  void getListByPageTest() {
+    ArrayList<DatasourceEnvEntity> t = new ArrayList<>();
+    DatasourceEnvEntity datasourceEnvEntity = new DatasourceEnvEntity();
+    datasourceEnvEntity.setId(0);
+    datasourceEnvEntity.setEnvName("test");
+    datasourceEnvEntity.setEnvDesc("test");
+    datasourceEnvEntity.setDatasourceTypeId(0);
+    datasourceEnvEntity.setParameter("test");
+    datasourceEnvEntity.setCreateTime(new Date());
+    datasourceEnvEntity.setCreateUser("test");
+    datasourceEnvEntity.setModifyTime(new Date());
+    datasourceEnvEntity.setModifyUser("test");
+    t.add(datasourceEnvEntity);
+    Mockito.when(datasourceEnvMapper.getListByPage("")).thenReturn(t);
+    PageInfo listByPage = datasourceEnvService.getListByPage("", 1, 1);
+    Assertions.assertTrue(listByPage.getSize() > 0);
+    logger.info(listByPage.toString());
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceTypeKeyServiceTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceTypeKeyServiceTest.java
new file mode 100644
index 000000000..92b5ddb7f
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceTypeKeyServiceTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.service;
+
+import org.apache.linkis.basedatamanager.server.dao.DatasourceTypeKeyMapper;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceTypeEntity;
+import 
org.apache.linkis.basedatamanager.server.service.impl.DatasourceTypeKeyServiceImpl;
+
+import java.util.ArrayList;
+
+import com.github.pagehelper.PageInfo;
+import org.junit.jupiter.api.Assertions;
+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.junit.jupiter.MockitoExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+@ExtendWith(MockitoExtension.class)
+class DatasourceTypeKeyServiceTest {
+
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceTypeServiceTest.class);
+
+  @InjectMocks private DatasourceTypeKeyServiceImpl datasourceTypeKeyService;
+
+  @Mock private DatasourceTypeKeyMapper datasourceTypeKeyMapper;
+
+  @Test
+  void getListByPageTest() {
+    ArrayList<DatasourceTypeEntity> t = new ArrayList<>();
+    DatasourceTypeEntity datasourceTypeEntity = new DatasourceTypeEntity();
+    datasourceTypeEntity.setId(0);
+    datasourceTypeEntity.setName("test");
+    datasourceTypeEntity.setDescription("test");
+    datasourceTypeEntity.setOption("test");
+    datasourceTypeEntity.setClassifier("test");
+    datasourceTypeEntity.setIcon("test");
+    datasourceTypeEntity.setLayers(0);
+    t.add(datasourceTypeEntity);
+    Mockito.when(datasourceTypeKeyMapper.getListByPage("", 1)).thenReturn(t);
+    PageInfo listByPage = datasourceTypeKeyService.getListByPage("", 1, 1, 10);
+    Assertions.assertTrue(listByPage.getSize() > 0);
+    logger.info(listByPage.toString());
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceTypeServiceTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceTypeServiceTest.java
new file mode 100644
index 000000000..e31b942d5
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/DatasourceTypeServiceTest.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.service;
+
+import org.apache.linkis.basedatamanager.server.dao.DatasourceTypeMapper;
+import org.apache.linkis.basedatamanager.server.domain.DatasourceTypeEntity;
+import 
org.apache.linkis.basedatamanager.server.service.impl.DatasourceTypeServiceImpl;
+
+import java.util.ArrayList;
+
+import com.github.pagehelper.PageInfo;
+import org.junit.jupiter.api.Assertions;
+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.junit.jupiter.MockitoExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+@ExtendWith(MockitoExtension.class)
+class DatasourceTypeServiceTest {
+
+  private Logger logger = 
LoggerFactory.getLogger(DatasourceTypeServiceTest.class);
+  @InjectMocks private DatasourceTypeServiceImpl datasourceTypeService;
+
+  @Mock private DatasourceTypeMapper datasourceTypeMapper;
+
+  @Test
+  void getListByPageTest() {
+    ArrayList<DatasourceTypeEntity> t = new ArrayList<>();
+    DatasourceTypeEntity datasourceTypeEntity = new DatasourceTypeEntity();
+    datasourceTypeEntity.setId(0);
+    datasourceTypeEntity.setName("test");
+    datasourceTypeEntity.setDescription("test");
+    datasourceTypeEntity.setOption("test");
+    datasourceTypeEntity.setClassifier("test");
+    datasourceTypeEntity.setIcon("test");
+    datasourceTypeEntity.setLayers(0);
+    t.add(datasourceTypeEntity);
+    Mockito.when(datasourceTypeMapper.getListByPage("")).thenReturn(t);
+    PageInfo listByPage = datasourceTypeService.getListByPage("", 1, 10);
+    Assertions.assertTrue(listByPage.getSize() > 0);
+    logger.info(listByPage.toString());
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/ErrorCodeServiceTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/ErrorCodeServiceTest.java
new file mode 100644
index 000000000..71aa5f505
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/ErrorCodeServiceTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.service;
+
+import org.apache.linkis.basedatamanager.server.dao.PsErrorCodeMapper;
+import org.apache.linkis.basedatamanager.server.domain.ErrorCodeEntity;
+import 
org.apache.linkis.basedatamanager.server.service.impl.ErrorCodeServiceImpl;
+
+import java.util.ArrayList;
+
+import com.github.pagehelper.PageInfo;
+import org.junit.jupiter.api.Assertions;
+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.junit.jupiter.MockitoExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+@ExtendWith(MockitoExtension.class)
+class ErrorCodeServiceTest {
+
+  private Logger logger = LoggerFactory.getLogger(ErrorCodeServiceTest.class);
+
+  @InjectMocks private ErrorCodeServiceImpl errorCodeService;
+
+  @Mock private PsErrorCodeMapper psErrorCodeMapper;
+
+  @Test
+  void getListByPageTest() {
+    ArrayList<ErrorCodeEntity> t = new ArrayList<>();
+    ErrorCodeEntity errorCodeEntity = new ErrorCodeEntity();
+    errorCodeEntity.setId(0L);
+    errorCodeEntity.setErrorCode("test");
+    errorCodeEntity.setErrorDesc("test");
+    errorCodeEntity.setErrorRegex("test");
+    errorCodeEntity.setErrorType(0);
+    t.add(errorCodeEntity);
+    Mockito.when(psErrorCodeMapper.getListByPage("")).thenReturn(t);
+    PageInfo listByPage = errorCodeService.getListByPage("", 1, 10);
+    Assertions.assertTrue(listByPage.getSize() > 0);
+    logger.info(listByPage.toString());
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/GatewayAuthTokenServiceTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/GatewayAuthTokenServiceTest.java
new file mode 100644
index 000000000..f8e84b8b6
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/GatewayAuthTokenServiceTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.service;
+
+import org.apache.linkis.basedatamanager.server.dao.GatewayAuthTokenMapper;
+import org.apache.linkis.basedatamanager.server.domain.GatewayAuthTokenEntity;
+import 
org.apache.linkis.basedatamanager.server.service.impl.GatewayAuthTokenServiceImpl;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import com.github.pagehelper.PageInfo;
+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.junit.jupiter.MockitoExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+@ExtendWith(MockitoExtension.class)
+class GatewayAuthTokenServiceTest {
+  private Logger logger = 
LoggerFactory.getLogger(GatewayAuthTokenServiceTest.class);
+  @InjectMocks private GatewayAuthTokenServiceImpl gatewayAuthTokenService;
+  @Mock private GatewayAuthTokenMapper gatewayAuthTokenMapper;
+
+  @Test
+  public void getListByPageTest() {
+    ArrayList<GatewayAuthTokenEntity> t = new ArrayList<>();
+    GatewayAuthTokenEntity gatewayAuthTokenEntity = new 
GatewayAuthTokenEntity();
+    gatewayAuthTokenEntity.setId(0);
+    gatewayAuthTokenEntity.setTokenName("test");
+    gatewayAuthTokenEntity.setLegalUsers("test");
+    gatewayAuthTokenEntity.setLegalHosts("test");
+    gatewayAuthTokenEntity.setBusinessOwner("test");
+    gatewayAuthTokenEntity.setCreateTime(new Date());
+    gatewayAuthTokenEntity.setUpdateTime(new Date());
+    gatewayAuthTokenEntity.setElapseDay(0L);
+    gatewayAuthTokenEntity.setUpdateBy("test");
+    t.add(gatewayAuthTokenEntity);
+    Mockito.when(gatewayAuthTokenMapper.getListByPage("")).thenReturn(t);
+    PageInfo listByPage = gatewayAuthTokenService.getListByPage("", 1, 10);
+    logger.info(listByPage.toString());
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/RmExternalResourceProviderServiceTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/RmExternalResourceProviderServiceTest.java
new file mode 100644
index 000000000..aa5e2674c
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/RmExternalResourceProviderServiceTest.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.service;
+
+import 
org.apache.linkis.basedatamanager.server.dao.RmExternalResourceProviderMapper;
+import 
org.apache.linkis.basedatamanager.server.domain.RmExternalResourceProviderEntity;
+import 
org.apache.linkis.basedatamanager.server.service.impl.RmExternalResourceProviderServiceImpl;
+
+import org.springframework.util.Assert;
+
+import java.util.ArrayList;
+
+import com.github.pagehelper.PageInfo;
+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.junit.jupiter.MockitoExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith(MockitoExtension.class)
+class RmExternalResourceProviderServiceTest {
+  private Logger logger = LoggerFactory.getLogger(UdfTreeServiceTest.class);
+  @InjectMocks private RmExternalResourceProviderServiceImpl 
rmExternalResourceProviderService;
+  @Mock private RmExternalResourceProviderMapper 
rmExternalResourceProviderMapper;
+
+  @Test
+  public void getListByPageTest() {
+    ArrayList<RmExternalResourceProviderEntity> t = new ArrayList<>();
+    RmExternalResourceProviderEntity rmExternalResourceProviderEntity =
+        new RmExternalResourceProviderEntity();
+    rmExternalResourceProviderEntity.setId(0);
+    rmExternalResourceProviderEntity.setResourceType("test");
+    rmExternalResourceProviderEntity.setName("test");
+    rmExternalResourceProviderEntity.setLabels("test");
+    rmExternalResourceProviderEntity.setConfig("test");
+    t.add(rmExternalResourceProviderEntity);
+    
Mockito.when(rmExternalResourceProviderMapper.getListByPage("")).thenReturn(t);
+    PageInfo listByPage = rmExternalResourceProviderService.getListByPage("", 
1, 10);
+    Assert.isTrue(listByPage.getSize() > 0);
+    logger.info(listByPage.toString());
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/UdfManagerServiceTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/UdfManagerServiceTest.java
new file mode 100644
index 000000000..95734dc0b
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/UdfManagerServiceTest.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.service;
+
+import org.apache.linkis.basedatamanager.server.Scan;
+import org.apache.linkis.basedatamanager.server.WebApplicationServer;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import com.github.pagehelper.PageInfo;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SpringBootTest(classes = {WebApplicationServer.class, Scan.class})
+public class UdfManagerServiceTest {
+  private Logger logger = LoggerFactory.getLogger(UdfManagerServiceTest.class);
+  @Autowired private UdfManagerService udfManagerService;
+
+  @Test
+  public void getListByPage() {
+    PageInfo listByPage = udfManagerService.getListByPage("", 1, 10);
+    Assertions.assertTrue(listByPage.getSize() > 0);
+    logger.info(listByPage.toString());
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/UdfTreeServiceTest.java
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/UdfTreeServiceTest.java
new file mode 100644
index 000000000..180efcaae
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/java/org/apache/linkis/basedatamanager/server/service/UdfTreeServiceTest.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.linkis.basedatamanager.server.service;
+
+import org.apache.linkis.basedatamanager.server.dao.UdfTreeMapper;
+import org.apache.linkis.basedatamanager.server.domain.UdfTreeEntity;
+import 
org.apache.linkis.basedatamanager.server.service.impl.UdfTreeServiceImpl;
+
+import org.springframework.util.Assert;
+
+import java.util.ArrayList;
+
+import com.github.pagehelper.PageInfo;
+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.junit.jupiter.MockitoExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@ExtendWith(MockitoExtension.class)
+public class UdfTreeServiceTest {
+  private Logger logger = LoggerFactory.getLogger(UdfTreeServiceTest.class);
+  @InjectMocks private UdfTreeServiceImpl udfTreeService;
+  @Mock private UdfTreeMapper udfTreeMapper;
+
+  @Test
+  public void getListByPageTest() {
+    ArrayList<UdfTreeEntity> t = new ArrayList<>();
+    UdfTreeEntity udfTreeEntity = new UdfTreeEntity();
+    udfTreeEntity.setId(3L);
+    udfTreeEntity.setParent(1l);
+    udfTreeEntity.setDescription("test");
+    udfTreeEntity.setName("test");
+    udfTreeEntity.setCategory("test");
+    udfTreeEntity.setUserName("test");
+    t.add(udfTreeEntity);
+    Mockito.when(udfTreeMapper.getListByPage("")).thenReturn(t);
+    PageInfo listByPage = udfTreeService.getListByPage("", 1, 10);
+    Assert.isTrue(listByPage.getSize() > 0);
+    logger.info(listByPage.toString());
+  }
+}
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/application.properties
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/application.properties
new file mode 100644
index 000000000..de76fcd5d
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/application.properties
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#wds.linkis.test.mode=true
+wds.linkis.server.version=v1
+
+#test
+wds.linkis.test.mode=true
+wds.linkis.test.user=hadoop
+
+
+##Linkis governance station administrators
+wds.linkis.governance.station.admin=hadoop
+wds.linkis.gateway.conf.publicservice.list=query,jobhistory,application,configuration,filesystem,udf,variable,microservice,errorcode,bml,datasource
+#
+
+logging.level.root=info
+logging.level.org.springframework.web=trace
+#logging.file=./test.log
+#debug=true
+
+spring.datasource.driver-class-name=org.h2.Driver
+spring.datasource.url=jdbc:h2:mem:test;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_LOWER=true
+spring.datasource.schema=classpath:create.sql
+spring.datasource.data=classpath:data.sql
+spring.datasource.username=sa
+spring.datasource.password=
+spring.datasource.hikari.connection-test-query=select 1
+spring.datasource.hikari.minimum-idle=5
+spring.datasource.hikari.auto-commit=true
+spring.datasource.hikari.validation-timeout=3000
+spring.datasource.hikari.pool-name=linkis-test
+spring.datasource.hikari.maximum-pool-size=50
+spring.datasource.hikari.connection-timeout=30000
+spring.datasource.hikari.idle-timeout=600000
+spring.datasource.hikari.leak-detection-threshold=0
+spring.datasource.hikari.initialization-fail-timeout=1
+
+spring.main.web-application-type=servlet
+server.port=1234
+spring.h2.console.enabled=true
+
+
+#disable eureka discovery client
+spring.cloud.service-registry.auto-registration.enabled=false
+eureka.client.enabled=false
+eureka.client.serviceUrl.registerWithEureka=false
+
+mybatis-plus.mapper-locations=classpath:org/apache/linkis/basedatamanager/server/dao/mapper/*.xml
+mybatis-plus.type-aliases-package=org.apache.linkis.basedatamanager.server.domain
+mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/create.sql
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/create.sql
new file mode 100644
index 000000000..55604307e
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/create.sql
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+SET
+    FOREIGN_KEY_CHECKS = 0;
+SET
+    REFERENTIAL_INTEGRITY FALSE;
+
+DROP TABLE IF EXISTS `linkis_ps_datasource_access`;
+CREATE TABLE `linkis_ps_datasource_access`
+(
+    `id`             bigint(20)  NOT NULL AUTO_INCREMENT,
+    `table_id`       bigint(20)  NOT NULL,
+    `visitor`        varchar(16) NOT NULL,
+    `fields`         varchar(255) DEFAULT NULL,
+    `application_id` int(4)      NOT NULL,
+    `access_time`    datetime    NOT NULL,
+    PRIMARY KEY (`id`)
+);
+
+DROP TABLE IF EXISTS `linkis_ps_dm_datasource_env`;
+CREATE TABLE `linkis_ps_dm_datasource_env`
+(
+    `id`                 int(11)                       NOT NULL AUTO_INCREMENT,
+    `env_name`           varchar(32)   NOT NULL,
+    `env_desc`           varchar(255)           DEFAULT NULL,
+    `datasource_type_id` int(11)                       NOT NULL,
+    `parameter`          varchar(1024)           DEFAULT NULL,
+    `create_time`        datetime                      NOT NULL DEFAULT 
CURRENT_TIMESTAMP,
+    `create_user`        varchar(255)  NULL     DEFAULT NULL,
+    `modify_time`        datetime                      NOT NULL DEFAULT 
CURRENT_TIMESTAMP,
+    `modify_user`        varchar(255)  NULL     DEFAULT NULL,
+    PRIMARY KEY (`id`),
+    UNIQUE KEY `uniq_env_name` (`env_name`),
+    UNIQUE INDEX `uniq_name_dtid` (`env_name`, `datasource_type_id`)
+);
+
+DROP TABLE IF EXISTS `linkis_ps_dm_datasource_type_key`;
+CREATE TABLE `linkis_ps_dm_datasource_type_key`
+(
+    `id`                  int(11)                       NOT NULL 
AUTO_INCREMENT,
+    `data_source_type_id` int(11)                       NOT NULL,
+    `key`                 varchar(32)   NOT NULL,
+    `name`                varchar(32)   NOT NULL,
+    `name_en`             varchar(32)   NOT NULL,
+    `default_value`       varchar(50)   NULL     DEFAULT NULL,
+    `value_type`          varchar(50)   NOT NULL,
+    `scope`               varchar(50)   NULL     DEFAULT NULL,
+    `require`             tinyint(1)                    NULL     DEFAULT 0,
+    `description`         varchar(200)  NULL     DEFAULT NULL,
+    `description_en`      varchar(200)  NULL     DEFAULT NULL,
+    `value_regex`         varchar(200)  NULL     DEFAULT NULL,
+    `ref_id`              bigint(20)                    NULL     DEFAULT NULL,
+    `ref_value`           varchar(50)   NULL     DEFAULT NULL,
+    `data_source`         varchar(200)  NULL     DEFAULT NULL,
+    `update_time`         datetime                      NOT NULL DEFAULT 
CURRENT_TIMESTAMP,
+    `create_time`         datetime                      NOT NULL DEFAULT 
CURRENT_TIMESTAMP,
+    PRIMARY KEY (`id`),
+    UNIQUE KEY `uniq_dstid_key` (`data_source_type_id`, `key`)
+);
+
+DROP TABLE IF EXISTS `linkis_ps_dm_datasource_type`;
+CREATE TABLE `linkis_ps_dm_datasource_type`
+(
+    `id`          int(11)                      NOT NULL AUTO_INCREMENT,
+    `name`        varchar(32)  NOT NULL,
+    `description` varchar(255)  DEFAULT NULL,
+    `option`      varchar(32)   DEFAULT NULL,
+    `classifier`  varchar(32)  NOT NULL,
+    `icon`        varchar(255)  DEFAULT NULL,
+    `layers`      int(3)                       NOT NULL,
+    PRIMARY KEY (`id`),
+    UNIQUE INDEX `uniq_name` (`name`)
+);
+
+DROP TABLE IF EXISTS `linkis_ps_error_code`;
+CREATE TABLE `linkis_ps_error_code` (
+                                        `id` bigint(20) NOT NULL 
AUTO_INCREMENT,
+                                        `error_code` varchar(50) NOT NULL,
+                                        `error_desc` varchar(1024) NOT NULL,
+                                        `error_regex` varchar(1024) DEFAULT 
NULL,
+                                        `error_type` int(3) DEFAULT 0,
+                                        PRIMARY KEY (`id`)
+);
+
+
+DROP TABLE IF EXISTS `linkis_mg_gateway_auth_token`;
+CREATE TABLE `linkis_mg_gateway_auth_token` (
+                                                `id` int(11) NOT NULL 
AUTO_INCREMENT,
+                                                `token_name` varchar(128) NOT 
NULL,
+                                                `legal_users` text,
+                                                `legal_hosts` text,
+                                                `business_owner` varchar(32),
+                                                `create_time` DATE DEFAULT 
NULL,
+                                                `update_time` DATE DEFAULT 
NULL,
+                                                `elapse_day` BIGINT DEFAULT 
NULL,
+                                                `update_by` varchar(32),
+                                                PRIMARY KEY (`id`),
+                                                UNIQUE KEY `uniq_token_name` 
(`token_name`)
+);
+
+
+DROP TABLE IF EXISTS `linkis_cg_rm_external_resource_provider`;
+CREATE TABLE `linkis_cg_rm_external_resource_provider` (
+                                                           `id` int(10) NOT 
NULL AUTO_INCREMENT,
+                                                           `resource_type` 
varchar(32) NOT NULL,
+                                                           `name` varchar(32) 
NOT NULL,
+                                                           `labels` 
varchar(32) DEFAULT NULL,
+                                                           `config` text NOT 
NULL,
+                                                           PRIMARY KEY (`id`)
+);
+
+
+DROP TABLE IF EXISTS `linkis_ps_udf_manager`;
+CREATE TABLE `linkis_ps_udf_manager` (
+                                         `id` bigint(20) NOT NULL 
AUTO_INCREMENT,
+                                         `user_name` varchar(20) DEFAULT NULL,
+                                         PRIMARY KEY (`id`)
+);
+
+DROP TABLE IF EXISTS `linkis_ps_udf_tree`;
+CREATE TABLE `linkis_ps_udf_tree` (
+                                      `id` bigint(20) NOT NULL AUTO_INCREMENT,
+                                      `parent` bigint(20) NOT NULL,
+                                      `name` varchar(100) DEFAULT NULL COMMENT 
'Category name of the function. It would be displayed in the front-end',
+                                      `user_name` varchar(50) NOT NULL,
+                                      `description` varchar(255) DEFAULT NULL,
+                                      `create_time` timestamp NOT NULL DEFAULT 
CURRENT_TIMESTAMP,
+                                      `update_time` timestamp NOT NULL DEFAULT 
CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+                                      `category` varchar(50) DEFAULT NULL 
COMMENT 'Used to distinguish between udf and function',
+                                      PRIMARY KEY (`id`)
+);
\ No newline at end of file
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/data.sql
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/data.sql
new file mode 100644
index 000000000..f231a9368
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/data.sql
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+DELETE FROM linkis_ps_datasource_access;
+INSERT INTO `linkis_ps_datasource_access` (`id`, `table_id`, `visitor`, 
`fields`, `application_id`, `access_time`) VALUES (1, 1, 'test', 'test', 1, 
'2022-12-20 22:54:36');
+
+
+DELETE FROM linkis_ps_dm_datasource_env;
+INSERT INTO `linkis_ps_dm_datasource_env` (`id`, `env_name`, `env_desc`, 
`datasource_type_id`, `parameter`, `create_time`, `create_user`, `modify_time`, 
`modify_user`) VALUES (1, '测试环境SIT', '测试环境SIT', 4, 
'{\"uris\":\"thrift://localhost:9083\", 
\"hadoopConf\":{\"hive.metastore.execute.setugi\":\"true\"}}', '2022-11-24 
20:46:21', NULL, '2022-11-24 20:46:21', NULL);
+
+DELETE FROM linkis_ps_dm_datasource_type_key;
+INSERT INTO `linkis_ps_dm_datasource_type_key` (`id`, `data_source_type_id`, 
`key`, `name`, `name_en`, `default_value`, `value_type`, `scope`, `require`, 
`description`, `description_en`, `value_regex`, `ref_id`, `ref_value`, 
`data_source`, `update_time`, `create_time`) VALUES (1, 1, 'host', '主机名(Host)', 
'Host', NULL, 'TEXT', NULL, 0, '主机名(Host)', 'Host1', NULL, NULL, NULL, NULL, 
'2022-11-24 20:46:21', '2022-11-24 20:46:21');
+
+DELETE FROM linkis_ps_dm_datasource_type;
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('kafka', 'kafka', 'kafka', '消息队列', '', 
2);
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES ('hive', 'hive数据库', 'hive', '大数据存储', '', 
3);
+INSERT INTO `linkis_ps_dm_datasource_type` (`name`, `description`, `option`, 
`classifier`, `icon`, `layers`) VALUES 
('elasticsearch','elasticsearch数据源','es无结构化存储','分布式全文索引','',3);
+
+DELETE FROM linkis_ps_error_code;
+INSERT INTO linkis_ps_error_code 
(error_code,error_desc,error_regex,error_type) VALUES 
('01001','您的任务没有路由到后台ECM,请联系管理员','The em of labels',0);
+
+DELETE FROM linkis_mg_gateway_auth_token;
+INSERT INTO 
`linkis_mg_gateway_auth_token`(`token_name`,`legal_users`,`legal_hosts`,`business_owner`,`create_time`,`update_time`,`elapse_day`,`update_by`)
 VALUES ('QML-AUTH','*','*','BDP',curdate(),curdate(),-1,'LINKIS');
+
+DELETE FROM linkis_cg_rm_external_resource_provider;
+insert  into 
`linkis_cg_rm_external_resource_provider`(`id`,`resource_type`,`name`,`labels`,`config`)
 values
+    
(1,'Yarn','default',NULL,'{"rmWebAddress":"@YARN_RESTFUL_URL","hadoopVersion":"@HADOOP_VERSION","authorEnable":@YARN_AUTH_ENABLE,"user":"@YARN_AUTH_USER","pwd":"@YARN_AUTH_PWD","kerberosEnable":@YARN_KERBEROS_ENABLE,"principalName":"@YARN_PRINCIPAL_NAME","keytabPath":"@YARN_KEYTAB_PATH","krb5Path":"@YARN_KRB5_PATH"}');
+
+
+DELETE FROM linkis_ps_udf_manager;
+insert into linkis_ps_udf_manager(`user_name`) values('udf_admin')
\ No newline at end of file
diff --git 
a/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/linkis.properties
 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/linkis.properties
new file mode 100644
index 000000000..1c575edc5
--- /dev/null
+++ 
b/linkis-public-enhancements/linkis-basedata-manager/src/test/resources/linkis.properties
@@ -0,0 +1,21 @@
+# 
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#wds.linkis.test.mode=true
+wds.linkis.server.version=v1
+
+#test
+wds.linkis.test.mode=true
+wds.linkis.test.user=hadoop
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to