3月 8, 2021*/ -@Import( - SysUserSessionServiceImpl.class) +@Import(SysUserSessionServiceImpl.class) public class SysUserSessionServiceImplTest extends BaseDbAndRedisUnitTest { @Resource - SysUserSessionServiceImpl sysUserSessionService; + private SysUserSessionServiceImpl sysUserSessionService; @Resource - SysUserSessionMapper sysUserSessionMapper; + private SysUserSessionMapper sysUserSessionMapper; + @MockBean - SecurityProperties securityProperties; + private SecurityProperties securityProperties; @MockBean - SysDeptServiceImpl sysDeptService; + private SysDeptServiceImpl sysDeptService; @MockBean - SysUserServiceImpl sysUserService; + private SysUserServiceImpl sysUserService; @MockBean - SysLoginLogServiceImpl sysLoginLogService; + private SysLoginLogServiceImpl sysLoginLogService; @MockBean - SysLoginUserRedisDAO sysLoginUserRedisDAO; + private SysLoginUserRedisDAO sysLoginUserRedisDAO; @Test public void testClearSessionTimeout_success() throws Exception { @@ -75,4 +74,4 @@ public class SysUserSessionServiceImplTest extends BaseDbAndRedisUnitTest { AssertUtils.assertPojoEquals(sessionDO, userSessionDOS.get(0), "updateTime"); } -} +} diff --git a/src/test/resources/file/erweima.jpg b/src/test/resources/file/erweima.jpg new file mode 100644 index 000000000..1447283cd Binary files /dev/null and b/src/test/resources/file/erweima.jpg differ diff --git a/src/test/resources/sql/clean.sql b/src/test/resources/sql/clean.sql index 7c847f5a1..75372fd1a 100644 --- a/src/test/resources/sql/clean.sql +++ b/src/test/resources/sql/clean.sql @@ -1,5 +1,6 @@ -- inf 开头的 DB DELETE FROM "inf_config"; +DELETE FROM "inf_file"; -- sys 开头的 DB DELETE FROM "sys_dept"; diff --git a/src/test/resources/sql/create_tables.sql b/src/test/resources/sql/create_tables.sql index 96ac8088a..36c573dd9 100644 --- a/src/test/resources/sql/create_tables.sql +++ b/src/test/resources/sql/create_tables.sql @@ -17,6 +17,18 @@ CREATE TABLE IF NOT EXISTS "inf_config" ( PRIMARY KEY ("id") ) COMMENT '参数配置表'; +CREATE TABLE IF NOT EXISTS "inf_file" ( + "id" varchar(188) NOT NULL, + "type" varchar(63) DEFAULT NULL, + "content" blob NOT NULL, + "creator" varchar(64) DEFAULT '', + "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar(64) DEFAULT '', + "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + PRIMARY KEY ("id") +) COMMENT '文件表'; + -- sys 开头的 DB CREATE TABLE IF NOT EXISTS "sys_dept" (