Commit cb4224af126a4580087bfc5ea0c6c0540d76ce26
1 parent
123617a9
1. 修复 FileServiceTest 单元测试
2. 修复 FileConfigServiceImplTest 单元测试
Showing
3 changed files
with
5 additions
and
3 deletions
yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java
| ... | ... | @@ -214,12 +214,13 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { |
| 214 | 214 | // 测试 storage 不匹配 |
| 215 | 215 | fileConfigMapper.insert(cloneIgnoreId(dbFileConfig, o -> o.setStorage(FileStorageEnum.DB.getStorage()))); |
| 216 | 216 | // 测试 createTime 不匹配 |
| 217 | - fileConfigMapper.insert(cloneIgnoreId(dbFileConfig, o -> o.setCreateTime(LocalDateTimeUtil.parse("2020-01-23", DatePattern.NORM_DATE_PATTERN)))); | |
| 217 | + fileConfigMapper.insert(cloneIgnoreId(dbFileConfig, o -> o.setCreateTime(LocalDateTimeUtil.parse("2020-11-23", DatePattern.NORM_DATE_PATTERN)))); | |
| 218 | 218 | // 准备参数 |
| 219 | 219 | FileConfigPageReqVO reqVO = new FileConfigPageReqVO(); |
| 220 | 220 | reqVO.setName("芋道"); |
| 221 | 221 | reqVO.setStorage(FileStorageEnum.LOCAL.getStorage()); |
| 222 | - reqVO.setCreateTime((new LocalDateTime[]{buildLocalDateTime(2022, 11, 10),buildLocalDateTime(2022, 11, 12)})); | |
| 222 | + reqVO.setCreateTime((new LocalDateTime[]{buildLocalDateTime(2020, 1, 1), | |
| 223 | + buildLocalDateTime(2020, 1, 24)})); | |
| 223 | 224 | |
| 224 | 225 | // 调用 |
| 225 | 226 | PageResult<FileConfigDO> pageResult = fileConfigService.getFileConfigPage(reqVO); | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java
| ... | ... | @@ -91,7 +91,7 @@ public class FileServiceTest extends BaseDbUnitTest { |
| 91 | 91 | assertEquals(10L, file.getConfigId()); |
| 92 | 92 | assertEquals(path, file.getPath()); |
| 93 | 93 | assertEquals(url, file.getUrl()); |
| 94 | - assertEquals("image/jpg", file.getType()); | |
| 94 | + assertEquals("image/jpeg", file.getType()); | |
| 95 | 95 | assertEquals(content.length, file.getSize()); |
| 96 | 96 | } |
| 97 | 97 | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql
| ... | ... | @@ -34,6 +34,7 @@ CREATE TABLE IF NOT EXISTS "infra_file_config" ( |
| 34 | 34 | CREATE TABLE IF NOT EXISTS "infra_file" ( |
| 35 | 35 | "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
| 36 | 36 | "config_id" bigint NOT NULL, |
| 37 | + "name" varchar(256), | |
| 37 | 38 | "path" varchar(512), |
| 38 | 39 | "url" varchar(1024), |
| 39 | 40 | "type" varchar(63) DEFAULT NULL, | ... | ... |