Commit aa5f4823579d72de19595feac2a84638f564287c
1 parent
2bbb7f86
【同步】BOOT 和 CLOUD 的功能
Showing
1 changed file
with
7 additions
and
0 deletions
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 { | @@ -209,6 +209,13 @@ public class AdminAuthServiceImplTest extends BaseDbUnitTest { | ||
| 209 | String mobile = randomString(); | 209 | String mobile = randomString(); |
| 210 | String code = randomString(); | 210 | String code = randomString(); |
| 211 | AuthSmsLoginReqVO reqVO = new AuthSmsLoginReqVO(mobile, code); | 211 | AuthSmsLoginReqVO reqVO = new AuthSmsLoginReqVO(mobile, code); |
| 212 | + // mock 方法(验证码) | ||
| 213 | + doNothing().when(smsCodeApi).useSmsCode((argThat(smsCodeUseReqDTO -> { | ||
| 214 | + assertEquals(mobile, smsCodeUseReqDTO.getMobile()); | ||
| 215 | + assertEquals(code, smsCodeUseReqDTO.getCode()); | ||
| 216 | + assertEquals(SmsSceneEnum.ADMIN_MEMBER_LOGIN.getScene(), smsCodeUseReqDTO.getScene()); | ||
| 217 | + return true; | ||
| 218 | + }))); | ||
| 212 | // mock 方法(用户信息) | 219 | // mock 方法(用户信息) |
| 213 | AdminUserDO user = randomPojo(AdminUserDO.class, o -> o.setId(1L)); | 220 | AdminUserDO user = randomPojo(AdminUserDO.class, o -> o.setId(1L)); |
| 214 | when(userService.getUserByMobile(eq(mobile))).thenReturn(user); | 221 | when(userService.getUserByMobile(eq(mobile))).thenReturn(user); |