Showing
4 changed files
with
57 additions
and
5 deletions
| @@ -13,6 +13,10 @@ public class OpenIdTest { | @@ -13,6 +13,10 @@ public class OpenIdTest { | ||
| 13 | private static final String URL_OPEN_ID = Constants.URL_PREFIX + "/openId"; | 13 | private static final String URL_OPEN_ID = Constants.URL_PREFIX + "/openId"; |
| 14 | private static final String URL_LOGIN = Constants.URL_PREFIX + "/openId/login"; | 14 | private static final String URL_LOGIN = Constants.URL_PREFIX + "/openId/login"; |
| 15 | private static final String URL_COMPARE = Constants.URL_PREFIX + "/report/compare"; | 15 | private static final String URL_COMPARE = Constants.URL_PREFIX + "/report/compare"; |
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * OpenId绑定接口 | ||
| 19 | + */ | ||
| 16 | @Test | 20 | @Test |
| 17 | public void testBind(){ | 21 | public void testBind(){ |
| 18 | bindWithOpenIdAndUser(); | 22 | bindWithOpenIdAndUser(); |
| @@ -32,6 +36,9 @@ public class OpenIdTest { | @@ -32,6 +36,9 @@ public class OpenIdTest { | ||
| 32 | return response; | 36 | return response; |
| 33 | } | 37 | } |
| 34 | 38 | ||
| 39 | + /** | ||
| 40 | + * OpenId解除绑定接口 | ||
| 41 | + */ | ||
| 35 | @Test | 42 | @Test |
| 36 | public void testUnBind(){ | 43 | public void testUnBind(){ |
| 37 | Map<String,String> params = new HashMap<String, String>(); | 44 | Map<String,String> params = new HashMap<String, String>(); |
| @@ -47,6 +54,9 @@ public class OpenIdTest { | @@ -47,6 +54,9 @@ public class OpenIdTest { | ||
| 47 | System.out.println(response); | 54 | System.out.println(response); |
| 48 | } | 55 | } |
| 49 | 56 | ||
| 57 | + /** | ||
| 58 | + * OpenId登陆接口 | ||
| 59 | + */ | ||
| 50 | @Test | 60 | @Test |
| 51 | public void testLogin(){ | 61 | public void testLogin(){ |
| 52 | System.out.println(bindWithOpenIdAndLoginAndGetToken("abcdefghijklmnopqrstuvwxyz123456","0")); | 62 | System.out.println(bindWithOpenIdAndLoginAndGetToken("abcdefghijklmnopqrstuvwxyz123456","0")); |
| @@ -69,11 +79,14 @@ public class OpenIdTest { | @@ -69,11 +79,14 @@ public class OpenIdTest { | ||
| 69 | return content.getString("userId") + "_" + content.getString("token"); | 79 | return content.getString("userId") + "_" + content.getString("token"); |
| 70 | } | 80 | } |
| 71 | 81 | ||
| 82 | + /** | ||
| 83 | + * 微信端体检报告分年龄比较接口 | ||
| 84 | + */ | ||
| 72 | @Test | 85 | @Test |
| 73 | public void testCompare(){ | 86 | public void testCompare(){ |
| 74 | String token = bindWithOpenIdAndLoginAndGetToken("abcdefghijklmnopqrstuvwxyz123456","0"); | 87 | String token = bindWithOpenIdAndLoginAndGetToken("abcdefghijklmnopqrstuvwxyz123456","0"); |
| 75 | Map<String,String> params = new HashMap<String, String>(); | 88 | Map<String,String> params = new HashMap<String, String>(); |
| 76 | - params.put("report_id","1"); | 89 | + params.put("report_id","77"); |
| 77 | 90 | ||
| 78 | params.put("t",HttpTools.getNow()); | 91 | params.put("t",HttpTools.getNow()); |
| 79 | params.put("type","1"); | 92 | params.put("type","1"); |
| @@ -25,6 +25,9 @@ public class ReportTest { | @@ -25,6 +25,9 @@ public class ReportTest { | ||
| 25 | token = loginAndGetToken("user1","pass1"); | 25 | token = loginAndGetToken("user1","pass1"); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | + /** | ||
| 29 | + * 体检报告列表查询接口 | ||
| 30 | + */ | ||
| 28 | @Test | 31 | @Test |
| 29 | public void testList(){ | 32 | public void testList(){ |
| 30 | Map<String,String> params = new HashMap<String, String>(); | 33 | Map<String,String> params = new HashMap<String, String>(); |
| @@ -35,10 +38,13 @@ public class ReportTest { | @@ -35,10 +38,13 @@ public class ReportTest { | ||
| 35 | System.out.println(response); | 38 | System.out.println(response); |
| 36 | } | 39 | } |
| 37 | 40 | ||
| 41 | + /** | ||
| 42 | + * 体检报告详情查询接口 | ||
| 43 | + */ | ||
| 38 | @Test | 44 | @Test |
| 39 | public void testDetail(){ | 45 | public void testDetail(){ |
| 40 | Map<String,String> params = new HashMap<String, String>(); | 46 | Map<String,String> params = new HashMap<String, String>(); |
| 41 | - params.put("report_id","1"); | 47 | + params.put("report_id","77"); |
| 42 | params.put("t",HttpTools.getNow()); | 48 | params.put("t",HttpTools.getNow()); |
| 43 | params.put("type","1"); | 49 | params.put("type","1"); |
| 44 | params.put("sign",HttpTools.getSign(params)); | 50 | params.put("sign",HttpTools.getSign(params)); |
| @@ -46,10 +52,13 @@ public class ReportTest { | @@ -46,10 +52,13 @@ public class ReportTest { | ||
| 46 | System.out.println(response); | 52 | System.out.println(response); |
| 47 | } | 53 | } |
| 48 | 54 | ||
| 55 | + /** | ||
| 56 | + * 健康评分接口 | ||
| 57 | + */ | ||
| 49 | @Test | 58 | @Test |
| 50 | public void testScore(){ | 59 | public void testScore(){ |
| 51 | Map<String,String> params = new HashMap<String, String>(); | 60 | Map<String,String> params = new HashMap<String, String>(); |
| 52 | - params.put("report_id","1"); | 61 | + params.put("report_id","77"); |
| 53 | params.put("t",HttpTools.getNow()); | 62 | params.put("t",HttpTools.getNow()); |
| 54 | params.put("type","1"); | 63 | params.put("type","1"); |
| 55 | params.put("sign",HttpTools.getSign(params)); | 64 | params.put("sign",HttpTools.getSign(params)); |
| @@ -57,6 +66,9 @@ public class ReportTest { | @@ -57,6 +66,9 @@ public class ReportTest { | ||
| 57 | System.out.println(response); | 66 | System.out.println(response); |
| 58 | } | 67 | } |
| 59 | 68 | ||
| 69 | + /** | ||
| 70 | + * 体检报告指标解释查询接口 | ||
| 71 | + */ | ||
| 60 | @Test | 72 | @Test |
| 61 | public void testItemInfo(){ | 73 | public void testItemInfo(){ |
| 62 | Map<String,String> params = new HashMap<String, String>(); | 74 | Map<String,String> params = new HashMap<String, String>(); |
| @@ -70,6 +82,9 @@ public class ReportTest { | @@ -70,6 +82,9 @@ public class ReportTest { | ||
| 70 | System.out.println(response); | 82 | System.out.println(response); |
| 71 | } | 83 | } |
| 72 | 84 | ||
| 85 | + /** | ||
| 86 | + * 体检报告指标解释查询接口(过滤html标签) | ||
| 87 | + */ | ||
| 73 | @Test | 88 | @Test |
| 74 | public void testItemInfoPureHtml(){ | 89 | public void testItemInfoPureHtml(){ |
| 75 | Map<String,String> params = new HashMap<String, String>(); | 90 | Map<String,String> params = new HashMap<String, String>(); |
| @@ -83,12 +98,15 @@ public class ReportTest { | @@ -83,12 +98,15 @@ public class ReportTest { | ||
| 83 | System.out.println(response); | 98 | System.out.println(response); |
| 84 | } | 99 | } |
| 85 | 100 | ||
| 101 | + /** | ||
| 102 | + * 体检报告指标曲线查询接口 | ||
| 103 | + */ | ||
| 86 | @Test | 104 | @Test |
| 87 | public void testItemGraph(){ | 105 | public void testItemGraph(){ |
| 88 | Map<String,String> params = new HashMap<String, String>(); | 106 | Map<String,String> params = new HashMap<String, String>(); |
| 89 | params.put("itemId","10"); | 107 | params.put("itemId","10"); |
| 90 | - params.put("stime","2016-01-01 10:32:00"); | ||
| 91 | - params.put("etime","2016-12-22 10:32:00"); | 108 | + params.put("stime","2010-01-01 10:32:00"); |
| 109 | + params.put("etime","2019-12-22 10:32:00"); | ||
| 92 | params.put("t",HttpTools.getNow()); | 110 | params.put("t",HttpTools.getNow()); |
| 93 | params.put("type","1"); | 111 | params.put("type","1"); |
| 94 | params.put("sign",HttpTools.getSign(params)); | 112 | params.put("sign",HttpTools.getSign(params)); |
| @@ -27,11 +27,17 @@ public class TokenTest { | @@ -27,11 +27,17 @@ public class TokenTest { | ||
| 27 | return content.getString("userId") + "_" + content.getString("token"); | 27 | return content.getString("userId") + "_" + content.getString("token"); |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | + /** | ||
| 31 | + * 用户登录接口 | ||
| 32 | + */ | ||
| 30 | @Test | 33 | @Test |
| 31 | public void testLogin(){ | 34 | public void testLogin(){ |
| 32 | System.out.println(loginAndGetToken("user1","pass1")); | 35 | System.out.println(loginAndGetToken("user1","pass1")); |
| 33 | } | 36 | } |
| 34 | 37 | ||
| 38 | + /** | ||
| 39 | + * 用户退出登录接口 | ||
| 40 | + */ | ||
| 35 | @Test | 41 | @Test |
| 36 | public void logout(){ | 42 | public void logout(){ |
| 37 | String token = loginAndGetToken("user1","pass1"); | 43 | String token = loginAndGetToken("user1","pass1"); |
| @@ -14,11 +14,17 @@ import static com.xkl.TokenTest.loginAndGetToken; | @@ -14,11 +14,17 @@ import static com.xkl.TokenTest.loginAndGetToken; | ||
| 14 | public class UserInfoTest { | 14 | public class UserInfoTest { |
| 15 | private static final String URL_USER = Constants.URL_PREFIX + "/userInfo"; | 15 | private static final String URL_USER = Constants.URL_PREFIX + "/userInfo"; |
| 16 | 16 | ||
| 17 | + /** | ||
| 18 | + * 用户注册 | ||
| 19 | + */ | ||
| 17 | @Test | 20 | @Test |
| 18 | public void testRegister(){ | 21 | public void testRegister(){ |
| 19 | register("15211112222","pass152"); | 22 | register("15211112222","pass152"); |
| 20 | } | 23 | } |
| 21 | 24 | ||
| 25 | + /** | ||
| 26 | + * 用户修改密码 | ||
| 27 | + */ | ||
| 22 | @Test | 28 | @Test |
| 23 | public void testModPass(){ | 29 | public void testModPass(){ |
| 24 | register("15211112222","pass152"); | 30 | register("15211112222","pass152"); |
| @@ -35,6 +41,9 @@ public class UserInfoTest { | @@ -35,6 +41,9 @@ public class UserInfoTest { | ||
| 35 | System.out.println(response); | 41 | System.out.println(response); |
| 36 | } | 42 | } |
| 37 | 43 | ||
| 44 | + /** | ||
| 45 | + * 个人信息查询接口 | ||
| 46 | + */ | ||
| 38 | @Test | 47 | @Test |
| 39 | public void testGetUserInfo(){ | 48 | public void testGetUserInfo(){ |
| 40 | Map<String,String> params = new HashMap<String, String>(); | 49 | Map<String,String> params = new HashMap<String, String>(); |
| @@ -59,6 +68,9 @@ public class UserInfoTest { | @@ -59,6 +68,9 @@ public class UserInfoTest { | ||
| 59 | System.out.println(response); | 68 | System.out.println(response); |
| 60 | } | 69 | } |
| 61 | 70 | ||
| 71 | + /** | ||
| 72 | + * 错误的注册:不带sign | ||
| 73 | + */ | ||
| 62 | @Test | 74 | @Test |
| 63 | public void testRegisterNoSign(){ | 75 | public void testRegisterNoSign(){ |
| 64 | Map<String,String> params = new HashMap<String, String>(); | 76 | Map<String,String> params = new HashMap<String, String>(); |
| @@ -71,6 +83,9 @@ public class UserInfoTest { | @@ -71,6 +83,9 @@ public class UserInfoTest { | ||
| 71 | System.out.println(response); | 83 | System.out.println(response); |
| 72 | } | 84 | } |
| 73 | 85 | ||
| 86 | + /** | ||
| 87 | + * 错误注册:客户端与服务端时间差距过大 | ||
| 88 | + */ | ||
| 74 | @Test | 89 | @Test |
| 75 | public void testRegisterWrongTime(){ | 90 | public void testRegisterWrongTime(){ |
| 76 | Map<String,String> params = new HashMap<String, String>(); | 91 | Map<String,String> params = new HashMap<String, String>(); |
-
Please register or login to post a comment