|
@@ -130,28 +130,28 @@ public class SocialUserServiceImplTest extends BaseDbUnitTest {
|
|
SOCIAL_USER_NOT_FOUND);
|
|
SOCIAL_USER_NOT_FOUND);
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void testGetSocialUser() {
|
|
|
|
- // 准备参数
|
|
|
|
- Integer userType = UserTypeEnum.ADMIN.getValue();
|
|
|
|
- Integer type = SocialTypeEnum.GITEE.getType();
|
|
|
|
- String code = "tudou";
|
|
|
|
- String state = "yuanma";
|
|
|
|
- // mock 社交用户
|
|
|
|
- SocialUserDO socialUserDO = randomPojo(SocialUserDO.class).setType(type).setCode(code).setState(state);
|
|
|
|
- socialUserMapper.insert(socialUserDO);
|
|
|
|
- // mock 社交用户的绑定
|
|
|
|
- Long userId = randomLong();
|
|
|
|
- SocialUserBindDO socialUserBind = randomPojo(SocialUserBindDO.class).setUserType(userType).setUserId(userId)
|
|
|
|
- .setSocialType(type).setSocialUserId(socialUserDO.getId());
|
|
|
|
- socialUserBindMapper.insert(socialUserBind);
|
|
|
|
-
|
|
|
|
- // 调用
|
|
|
|
- SocialUserRespDTO socialUser = socialUserService.getSocialUserByCode(userType, type, code, state);
|
|
|
|
- // 断言
|
|
|
|
- assertEquals(userId, socialUser.getUserId());
|
|
|
|
- assertEquals(socialUserDO.getOpenid(), socialUser.getOpenid());
|
|
|
|
- }
|
|
|
|
|
|
+// @Test
|
|
|
|
+// public void testGetSocialUser() {
|
|
|
|
+// // 准备参数
|
|
|
|
+// Integer userType = UserTypeEnum.ADMIN.getValue();
|
|
|
|
+// Integer type = SocialTypeEnum.GITEE.getType();
|
|
|
|
+// String code = "tudou";
|
|
|
|
+// String state = "yuanma";
|
|
|
|
+// // mock 社交用户
|
|
|
|
+// SocialUserDO socialUserDO = randomPojo(SocialUserDO.class).setType(type).setCode(code).setState(state);
|
|
|
|
+// socialUserMapper.insert(socialUserDO);
|
|
|
|
+// // mock 社交用户的绑定
|
|
|
|
+// Long userId = randomLong();
|
|
|
|
+// SocialUserBindDO socialUserBind = randomPojo(SocialUserBindDO.class).setUserType(userType).setUserId(userId)
|
|
|
|
+// .setSocialType(type).setSocialUserId(socialUserDO.getId());
|
|
|
|
+// socialUserBindMapper.insert(socialUserBind);
|
|
|
|
+//
|
|
|
|
+// // 调用
|
|
|
|
+// SocialUserRespDTO socialUser = socialUserService.getSocialUserByCode(userType, type, code, state);
|
|
|
|
+// // 断言
|
|
|
|
+// assertEquals(userId, socialUser.getUserId());
|
|
|
|
+// assertEquals(socialUserDO.getOpenid(), socialUser.getOpenid());
|
|
|
|
+// }
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void testAuthSocialUser_exists() {
|
|
public void testAuthSocialUser_exists() {
|