Skip to content

Commit

Permalink
fix linkis-udf unit testing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
“v_kkhuang” committed Sep 23, 2024
1 parent 9dab55a commit 9c182a7
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,4 @@ eureka.client.serviceUrl.registerWithEureka=false

mybatis-plus.mapper-locations=classpath*:mapper/common/*.xml,classpath*:mapper/mysql/*.xml
mybatis-plus.type-aliases-package=org.apache.linkis.jobhistory.entity
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
springfox.documentation.enabled=false
springfox.documentation.auto-startup=false
springfox.documentation.swagger-ui.enabled=false
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

import org.apache.linkis.udf.entity.PythonModuleInfo;

import org.springframework.test.context.event.annotation.BeforeTestClass;

import java.util.Arrays;
import java.util.List;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand All @@ -37,7 +36,7 @@ public class PythonModuleInfoMapperTest {
private PythonModuleInfoMapper pythonModuleInfoMapper; // PythonModuleInfoMapper 的模拟对象

/** 在每个测试方法执行前执行,用于初始化测试环境。 */
@BeforeTestClass
@BeforeEach
public void setUp() {
pythonModuleInfoMapper = mock(PythonModuleInfoMapper.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Arrays;
import java.util.List;

import org.aspectj.lang.annotation.Before;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
Expand All @@ -41,7 +41,7 @@ public class PythonModuleInfoServiceTest {
@InjectMocks private PythonModuleInfoServiceImpl pythonModuleInfoServiceImpl;

/** 在每个测试方法执行前执行,用于初始化测试环境。 */
@Before("")
@BeforeEach
public void setUp() {
MockitoAnnotations.openMocks(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spring.datasource.url=jdbc:h2:mem:test;MODE=MySQL;DB_CLOSE_DELAY=-1;DATABASE_TO_
spring.datasource.username=sa
spring.datasource.password=
spring.sql.init.schema-locations=classpath:create.sql
spring.datasource.data=classpath:data.sql
springfox.documentation.enabled=false
springfox.documentation.auto-startup=false
springfox.documentation.swagger-ui.enabled=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,20 @@ CREATE TABLE IF NOT EXISTS linkis_ps_udf_manager (
`update_time` datetime DEFAULT CURRENT_TIMESTAMP,
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `linkis_ps_python_module_info`;
CREATE TABLE `linkis_ps_python_module_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`name` varchar(255) NOT NULL COMMENT 'python模块名称',
`description` text COMMENT 'python模块描述',
`path` varchar(255) NOT NULL COMMENT 'hdfs路径',
`engine_type` varchar(50) NOT NULL COMMENT '引擎类型,python/spark/all',
`create_user` varchar(50) NOT NULL COMMENT '创建用户',
`update_user` varchar(50) NOT NULL COMMENT '修改用户',
`is_load` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否加载,0-未加载,1-已加载',
`is_expire` tinyint(1) DEFAULT NULL COMMENT '是否过期,0-未过期,1-已过期)',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='Python模块包信息表';

0 comments on commit 9c182a7

Please sign in to comment.