From a539bc211d73807b8c74b7f65fdab4b7778b980c Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 11 Nov 2022 08:55:28 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=20MemberAuthServiceTest?= =?UTF-8?q?=20=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=202.=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20DataPermissionDatabaseInterceptorTest=20=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/db/DataPermissionDatabaseInterceptorTest.java | 2 +- .../member/service/auth/MemberAuthServiceTest.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java index 4c1494aca2..145360789c 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptorTest.java @@ -87,7 +87,7 @@ public class DataPermissionDatabaseInterceptorTest extends BaseMockitoUnitTest { interceptor.beforeQuery(null, mappedStatement, null, null, null, boundSql); // 断言 verify(mpBs, times(1)).sql( - eq("SELECT * FROM t_user WHERE id = 1 AND dept_id = 100")); + eq("SELECT * FROM t_user WHERE id = 1 AND t_user.dept_id = 100")); // 断言缓存 assertTrue(interceptor.getMappedStatementCache().getNoRewritableMappedStatements().isEmpty()); } diff --git a/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java b/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java index 805d06aa6c..9fd67c9014 100644 --- a/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java +++ b/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceTest.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.member.service.auth; +import cn.binarywang.wx.miniapp.api.WxMaService; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; import cn.iocoder.yudao.framework.redis.config.YudaoRedisAutoConfiguration; @@ -39,6 +40,9 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { // TODO @芋艿:登录相关的单测,待补全 + @Resource + private MemberAuthServiceImpl authService; + @MockBean private MemberUserService userService; @MockBean @@ -50,11 +54,12 @@ public class MemberAuthServiceTest extends BaseDbAndRedisUnitTest { @MockBean private SocialUserApi socialUserApi; @MockBean + private WxMaService wxMaService; + @MockBean private PasswordEncoder passwordEncoder; + @Resource private MemberUserMapper memberUserMapper; - @Resource - private MemberAuthServiceImpl authService; @Test public void testUpdatePassword_success(){