Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
31bbcecb
提交
31bbcecb
authored
12月 29, 2022
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复报错的单元测试
上级
510de0c6
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
15 行增加
和
7 行删除
+15
-7
DeptDataPermissionRuleTest.java
...permission/core/rule/dept/DeptDataPermissionRuleTest.java
+1
-1
application-unit-test.yaml
...ule-bpm-biz/src/test/resources/application-unit-test.yaml
+1
-1
FileServiceTest.java
...oder/yudao/module/infra/service/file/FileServiceTest.java
+1
-1
application-unit-test.yaml
...e-infra-biz/src/test/resources/application-unit-test.yaml
+1
-1
DeptServiceTest.java
...der/yudao/module/system/service/dept/DeptServiceTest.java
+8
-0
DictDataServiceTest.java
...yudao/module/system/service/dict/DictDataServiceTest.java
+2
-2
application-unit-test.yaml
...-system-biz/src/test/resources/application-unit-test.yaml
+1
-1
没有找到文件。
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRuleTest.java
浏览文件 @
31bbcecb
...
@@ -231,7 +231,7 @@ class DeptDataPermissionRuleTest extends BaseMockitoUnitTest {
...
@@ -231,7 +231,7 @@ class DeptDataPermissionRuleTest extends BaseMockitoUnitTest {
// 调用
// 调用
Expression
expression
=
rule
.
getExpression
(
tableName
,
tableAlias
);
Expression
expression
=
rule
.
getExpression
(
tableName
,
tableAlias
);
// 断言
// 断言
assertEquals
(
"
u.dept_id IN (10, 20) OR u.id = 1
"
,
expression
.
toString
());
assertEquals
(
"
(u.dept_id IN (10, 20) OR u.id = 1)
"
,
expression
.
toString
());
assertSame
(
deptDataPermission
,
loginUser
.
getContext
(
DeptDataPermissionRule
.
CONTEXT_KEY
,
DeptDataPermissionRespDTO
.
class
));
assertSame
(
deptDataPermission
,
loginUser
.
getContext
(
DeptDataPermissionRule
.
CONTEXT_KEY
,
DeptDataPermissionRespDTO
.
class
));
}
}
}
}
...
...
yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/application-unit-test.yaml
浏览文件 @
31bbcecb
...
@@ -9,7 +9,7 @@ spring:
...
@@ -9,7 +9,7 @@ spring:
# 数据源配置项
# 数据源配置项
datasource
:
datasource
:
name
:
ruoyi-vue-pro
name
:
ruoyi-vue-pro
url
:
jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false;
# MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写
url
:
jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false;
NON_KEYWORDS=value;
# MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写
driver-class-name
:
org.h2.Driver
driver-class-name
:
org.h2.Driver
username
:
sa
username
:
sa
password
:
password
:
...
...
yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java
浏览文件 @
31bbcecb
...
@@ -78,7 +78,7 @@ public class FileServiceTest extends BaseDbUnitTest {
...
@@ -78,7 +78,7 @@ public class FileServiceTest extends BaseDbUnitTest {
FileClient
client
=
mock
(
FileClient
.
class
);
FileClient
client
=
mock
(
FileClient
.
class
);
when
(
fileConfigService
.
getMasterFileClient
()).
thenReturn
(
client
);
when
(
fileConfigService
.
getMasterFileClient
()).
thenReturn
(
client
);
String
url
=
randomString
();
String
url
=
randomString
();
when
(
client
.
upload
(
same
(
content
),
same
(
path
),
same
(
"image/jpeg"
))).
thenReturn
(
url
);
when
(
client
.
upload
(
same
(
content
),
same
(
path
),
eq
(
"image/jpeg"
))).
thenReturn
(
url
);
when
(
client
.
getId
()).
thenReturn
(
10L
);
when
(
client
.
getId
()).
thenReturn
(
10L
);
String
name
=
"单测文件名"
;
String
name
=
"单测文件名"
;
// 调用
// 调用
...
...
yudao-module-infra/yudao-module-infra-biz/src/test/resources/application-unit-test.yaml
浏览文件 @
31bbcecb
...
@@ -9,7 +9,7 @@ spring:
...
@@ -9,7 +9,7 @@ spring:
# 数据源配置项
# 数据源配置项
datasource
:
datasource
:
name
:
ruoyi-vue-pro
name
:
ruoyi-vue-pro
url
:
jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false;
# MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写
url
:
jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false;
NON_KEYWORDS=value;
# MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写
driver-class-name
:
org.h2.Driver
driver-class-name
:
org.h2.Driver
username
:
sa
username
:
sa
password
:
password
:
...
...
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceTest.java
浏览文件 @
31bbcecb
package
cn
.
iocoder
.
yudao
.
module
.
system
.
service
.
dept
;
package
cn
.
iocoder
.
yudao
.
module
.
system
.
service
.
dept
;
import
cn.iocoder.yudao.framework.common.enums.CommonStatusEnum
;
import
cn.iocoder.yudao.framework.common.enums.CommonStatusEnum
;
import
cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder
;
import
cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO
;
import
cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO
;
import
cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO
;
import
cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO
;
import
cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO
;
import
cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO
;
...
@@ -12,6 +13,7 @@ import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils;
...
@@ -12,6 +13,7 @@ import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils;
import
cn.iocoder.yudao.framework.common.util.object.ObjectUtils
;
import
cn.iocoder.yudao.framework.common.util.object.ObjectUtils
;
import
cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest
;
import
cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest
;
import
com.google.common.collect.Multimap
;
import
com.google.common.collect.Multimap
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.mock.mockito.MockBean
;
import
org.springframework.boot.test.mock.mockito.MockBean
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
...
@@ -47,6 +49,12 @@ public class DeptServiceTest extends BaseDbUnitTest {
...
@@ -47,6 +49,12 @@ public class DeptServiceTest extends BaseDbUnitTest {
@MockBean
@MockBean
private
DeptProducer
deptProducer
;
private
DeptProducer
deptProducer
;
@BeforeEach
public
void
setUp
()
{
// 清理租户上下文
TenantContextHolder
.
clear
();
}
@Test
@Test
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
void
testInitLocalCache
()
{
void
testInitLocalCache
()
{
...
...
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceTest.java
浏览文件 @
31bbcecb
...
@@ -57,7 +57,7 @@ public class DictDataServiceTest extends BaseDbUnitTest {
...
@@ -57,7 +57,7 @@ public class DictDataServiceTest extends BaseDbUnitTest {
// 准备参数
// 准备参数
DictDataPageReqVO
reqVO
=
new
DictDataPageReqVO
();
DictDataPageReqVO
reqVO
=
new
DictDataPageReqVO
();
reqVO
.
setLabel
(
"芋"
);
reqVO
.
setLabel
(
"芋"
);
reqVO
.
setDictType
(
"yu"
);
reqVO
.
setDictType
(
"yu
nai
"
);
reqVO
.
setStatus
(
CommonStatusEnum
.
ENABLE
.
getStatus
());
reqVO
.
setStatus
(
CommonStatusEnum
.
ENABLE
.
getStatus
());
// 调用
// 调用
...
@@ -86,7 +86,7 @@ public class DictDataServiceTest extends BaseDbUnitTest {
...
@@ -86,7 +86,7 @@ public class DictDataServiceTest extends BaseDbUnitTest {
// 准备参数
// 准备参数
DictDataExportReqVO
reqVO
=
new
DictDataExportReqVO
();
DictDataExportReqVO
reqVO
=
new
DictDataExportReqVO
();
reqVO
.
setLabel
(
"芋"
);
reqVO
.
setLabel
(
"芋"
);
reqVO
.
setDictType
(
"yu"
);
reqVO
.
setDictType
(
"yu
nai
"
);
reqVO
.
setStatus
(
CommonStatusEnum
.
ENABLE
.
getStatus
());
reqVO
.
setStatus
(
CommonStatusEnum
.
ENABLE
.
getStatus
());
// 调用
// 调用
...
...
yudao-module-system/yudao-module-system-biz/src/test/resources/application-unit-test.yaml
浏览文件 @
31bbcecb
...
@@ -9,7 +9,7 @@ spring:
...
@@ -9,7 +9,7 @@ spring:
# 数据源配置项
# 数据源配置项
datasource
:
datasource
:
name
:
ruoyi-vue-pro
name
:
ruoyi-vue-pro
url
:
jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false;
# MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写
url
:
jdbc:h2:mem:testdb;MODE=MYSQL;DATABASE_TO_UPPER=false;
NON_KEYWORDS=value;
# MODE 使用 MySQL 模式;DATABASE_TO_UPPER 配置表和字段使用小写
driver-class-name
:
org.h2.Driver
driver-class-name
:
org.h2.Driver
username
:
sa
username
:
sa
password
:
password
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论