mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
1. 修复 FileServiceTest 单元测试
2. 修复 FileConfigServiceImplTest 单元测试
This commit is contained in:
parent
123617a9af
commit
cb4224af12
@ -214,12 +214,13 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest {
|
||||
// 测试 storage 不匹配
|
||||
fileConfigMapper.insert(cloneIgnoreId(dbFileConfig, o -> o.setStorage(FileStorageEnum.DB.getStorage())));
|
||||
// 测试 createTime 不匹配
|
||||
fileConfigMapper.insert(cloneIgnoreId(dbFileConfig, o -> o.setCreateTime(LocalDateTimeUtil.parse("2020-01-23", DatePattern.NORM_DATE_PATTERN))));
|
||||
fileConfigMapper.insert(cloneIgnoreId(dbFileConfig, o -> o.setCreateTime(LocalDateTimeUtil.parse("2020-11-23", DatePattern.NORM_DATE_PATTERN))));
|
||||
// 准备参数
|
||||
FileConfigPageReqVO reqVO = new FileConfigPageReqVO();
|
||||
reqVO.setName("芋道");
|
||||
reqVO.setStorage(FileStorageEnum.LOCAL.getStorage());
|
||||
reqVO.setCreateTime((new LocalDateTime[]{buildLocalDateTime(2022, 11, 10),buildLocalDateTime(2022, 11, 12)}));
|
||||
reqVO.setCreateTime((new LocalDateTime[]{buildLocalDateTime(2020, 1, 1),
|
||||
buildLocalDateTime(2020, 1, 24)}));
|
||||
|
||||
// 调用
|
||||
PageResult<FileConfigDO> pageResult = fileConfigService.getFileConfigPage(reqVO);
|
||||
|
@ -91,7 +91,7 @@ public class FileServiceTest extends BaseDbUnitTest {
|
||||
assertEquals(10L, file.getConfigId());
|
||||
assertEquals(path, file.getPath());
|
||||
assertEquals(url, file.getUrl());
|
||||
assertEquals("image/jpg", file.getType());
|
||||
assertEquals("image/jpeg", file.getType());
|
||||
assertEquals(content.length, file.getSize());
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ CREATE TABLE IF NOT EXISTS "infra_file_config" (
|
||||
CREATE TABLE IF NOT EXISTS "infra_file" (
|
||||
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||
"config_id" bigint NOT NULL,
|
||||
"name" varchar(256),
|
||||
"path" varchar(512),
|
||||
"url" varchar(1024),
|
||||
"type" varchar(63) DEFAULT NULL,
|
||||
|
Loading…
Reference in New Issue
Block a user