From aa5f4823579d72de19595feac2a84638f564287c Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 1 Oct 2024 14:51:46 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=90=8C=E6=AD=A5=E3=80=91BOOT=20?= =?UTF-8?q?=E5=92=8C=20CLOUD=20=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/auth/AdminAuthServiceImplTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImplTest.java b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImplTest.java index c800f584e..0ad8fc342 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImplTest.java +++ b/yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImplTest.java @@ -209,6 +209,13 @@ public class AdminAuthServiceImplTest extends BaseDbUnitTest { String mobile = randomString(); String code = randomString(); AuthSmsLoginReqVO reqVO = new AuthSmsLoginReqVO(mobile, code); + // mock 方法(验证码) + doNothing().when(smsCodeApi).useSmsCode((argThat(smsCodeUseReqDTO -> { + assertEquals(mobile, smsCodeUseReqDTO.getMobile()); + assertEquals(code, smsCodeUseReqDTO.getCode()); + assertEquals(SmsSceneEnum.ADMIN_MEMBER_LOGIN.getScene(), smsCodeUseReqDTO.getScene()); + return true; + }))); // mock 方法(用户信息) AdminUserDO user = randomPojo(AdminUserDO.class, o -> o.setId(1L)); when(userService.getUserByMobile(eq(mobile))).thenReturn(user);