手机号授权: ouath2增加测试用例、追加日志输出

This commit is contained in:
lzm
2022-11-25 18:04:53 +08:00
committed by yeungchihang
parent 999556cfe7
commit 5a73a9b6f7
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package servicetest;
import com.accompany.oauth2.OAuth2Application;
import com.accompany.oauth2.service.MyUserDetailsService;
import com.alibaba.fastjson.JSON;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = OAuth2Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class CommonTest {
@Autowired
private MyUserDetailsService myUserDetailsService;
@Test
public void getUserClanInfoTest() {
try {
myUserDetailsService.loadUserByPhone("8615626451870","86","111111",null,"127.0.0.1");
myUserDetailsService.loadUserByPhone("8615626451870","86","122211",null,"127.2.2.1");
} catch (Exception e) {
e.printStackTrace();
}
}
}