Authored by fangyeqing

ADD:annotation

... ... @@ -13,6 +13,10 @@ public class OpenIdTest {
private static final String URL_OPEN_ID = Constants.URL_PREFIX + "/openId";
private static final String URL_LOGIN = Constants.URL_PREFIX + "/openId/login";
private static final String URL_COMPARE = Constants.URL_PREFIX + "/report/compare";
/**
* OpenId绑定接口
*/
@Test
public void testBind(){
bindWithOpenIdAndUser();
... ... @@ -32,6 +36,9 @@ public class OpenIdTest {
return response;
}
/**
* OpenId解除绑定接口
*/
@Test
public void testUnBind(){
Map<String,String> params = new HashMap<String, String>();
... ... @@ -47,6 +54,9 @@ public class OpenIdTest {
System.out.println(response);
}
/**
* OpenId登陆接口
*/
@Test
public void testLogin(){
System.out.println(bindWithOpenIdAndLoginAndGetToken("abcdefghijklmnopqrstuvwxyz123456","0"));
... ... @@ -69,11 +79,14 @@ public class OpenIdTest {
return content.getString("userId") + "_" + content.getString("token");
}
/**
* 微信端体检报告分年龄比较接口
*/
@Test
public void testCompare(){
String token = bindWithOpenIdAndLoginAndGetToken("abcdefghijklmnopqrstuvwxyz123456","0");
Map<String,String> params = new HashMap<String, String>();
params.put("report_id","1");
params.put("report_id","77");
params.put("t",HttpTools.getNow());
params.put("type","1");
... ...
... ... @@ -25,6 +25,9 @@ public class ReportTest {
token = loginAndGetToken("user1","pass1");
}
/**
* 体检报告列表查询接口
*/
@Test
public void testList(){
Map<String,String> params = new HashMap<String, String>();
... ... @@ -35,10 +38,13 @@ public class ReportTest {
System.out.println(response);
}
/**
* 体检报告详情查询接口
*/
@Test
public void testDetail(){
Map<String,String> params = new HashMap<String, String>();
params.put("report_id","1");
params.put("report_id","77");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("sign",HttpTools.getSign(params));
... ... @@ -46,10 +52,13 @@ public class ReportTest {
System.out.println(response);
}
/**
* 健康评分接口
*/
@Test
public void testScore(){
Map<String,String> params = new HashMap<String, String>();
params.put("report_id","1");
params.put("report_id","77");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("sign",HttpTools.getSign(params));
... ... @@ -57,6 +66,9 @@ public class ReportTest {
System.out.println(response);
}
/**
* 体检报告指标解释查询接口
*/
@Test
public void testItemInfo(){
Map<String,String> params = new HashMap<String, String>();
... ... @@ -70,6 +82,9 @@ public class ReportTest {
System.out.println(response);
}
/**
* 体检报告指标解释查询接口(过滤html标签)
*/
@Test
public void testItemInfoPureHtml(){
Map<String,String> params = new HashMap<String, String>();
... ... @@ -83,12 +98,15 @@ public class ReportTest {
System.out.println(response);
}
/**
* 体检报告指标曲线查询接口
*/
@Test
public void testItemGraph(){
Map<String,String> params = new HashMap<String, String>();
params.put("itemId","10");
params.put("stime","2016-01-01 10:32:00");
params.put("etime","2016-12-22 10:32:00");
params.put("stime","2010-01-01 10:32:00");
params.put("etime","2019-12-22 10:32:00");
params.put("t",HttpTools.getNow());
params.put("type","1");
params.put("sign",HttpTools.getSign(params));
... ...
... ... @@ -27,11 +27,17 @@ public class TokenTest {
return content.getString("userId") + "_" + content.getString("token");
}
/**
* 用户登录接口
*/
@Test
public void testLogin(){
System.out.println(loginAndGetToken("user1","pass1"));
}
/**
* 用户退出登录接口
*/
@Test
public void logout(){
String token = loginAndGetToken("user1","pass1");
... ...
... ... @@ -14,11 +14,17 @@ import static com.xkl.TokenTest.loginAndGetToken;
public class UserInfoTest {
private static final String URL_USER = Constants.URL_PREFIX + "/userInfo";
/**
* 用户注册
*/
@Test
public void testRegister(){
register("15211112222","pass152");
}
/**
* 用户修改密码
*/
@Test
public void testModPass(){
register("15211112222","pass152");
... ... @@ -35,6 +41,9 @@ public class UserInfoTest {
System.out.println(response);
}
/**
* 个人信息查询接口
*/
@Test
public void testGetUserInfo(){
Map<String,String> params = new HashMap<String, String>();
... ... @@ -59,6 +68,9 @@ public class UserInfoTest {
System.out.println(response);
}
/**
* 错误的注册:不带sign
*/
@Test
public void testRegisterNoSign(){
Map<String,String> params = new HashMap<String, String>();
... ... @@ -71,6 +83,9 @@ public class UserInfoTest {
System.out.println(response);
}
/**
* 错误注册:客户端与服务端时间差距过大
*/
@Test
public void testRegisterWrongTime(){
Map<String,String> params = new HashMap<String, String>();
... ...