@Override
    public AuthUser getAuthUser(Integer socialType, Integer userType, String code, String state) {
        // 构建请求
        AuthRequest authRequest = buildAuthRequest(socialType, userType);
        AuthCallback authCallback = AuthCallback.builder().code(code).state(state).build();
        // 执行请求
        AuthResponse<?> authResponse = authRequest.login(authCallback);
        log.info("[getAuthUser][请求社交平台 type({}) request({}) response({})]", socialType,
                toJsonString(authCallback), toJsonString(authResponse));
        if (!authResponse.ok()) {
            throw exception(SOCIAL_USER_AUTH_FAILURE, authResponse.getMsg());
        }
        return (AuthUser) authResponse.getData();
    }
@Test
    public void testAuthSocialUser_success() {
        // 准备参数
        Integer socialType = SocialTypeEnum.WECHAT_MP.getType();
        Integer userType = randomPojo(UserTypeEnum.class).getValue();
        String code = randomString();
        String state = randomString();
        // mock 方法（AuthRequest）
        AuthRequest authRequest = mock(AuthRequest.class);
        when(authRequestFactory.get(eq("WECHAT_MP"))).thenReturn(authRequest);
        // mock 方法（AuthResponse）
        AuthUser authUser = randomPojo(AuthUser.class);
        AuthResponse<?> authResponse = new AuthResponse<>(2000, null, authUser);
        when(authRequest.login(argThat(authCallback -> {
            assertEquals(code, authCallback.getCode());
            assertEquals(state, authCallback.getState());
            return true;
        }))).thenReturn(authResponse);

        // 调用
        AuthUser result = socialClientService.getAuthUser(socialType, userType, code, state);
        // 断言
        assertSame(authUser, result);
    }