From 8c4332f47d7c61d9f6a00668cf87bfdc89251808 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 11 Nov 2022 08:48:33 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=20FileServiceTest=20?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=202.=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20FileConfigServiceImplTest=20=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/infra/service/file/FileConfigServiceImplTest.java | 5 +++-- .../yudao/module/infra/service/file/FileServiceTest.java | 2 +- .../src/test/resources/sql/create_tables.sql | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java index bcaa1bf78..1b28b0e12 100755 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java +++ b/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 { // 测试 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 pageResult = fileConfigService.getFileConfigPage(reqVO); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java index f482238ec..33473360a 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileServiceTest.java @@ -90,7 +90,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()); } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql index c60230a4c..5825e0fef 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql +++ b/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" ( 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,