Authored by zhaoyue

Mod some var names

@@ -22,21 +22,23 @@ public class ReportTest { @@ -22,21 +22,23 @@ public class ReportTest {
22 private static String token; 22 private static String token;
23 23
24 @BeforeClass 24 @BeforeClass
25 - public static void init(){  
26 - token = loginAndGetToken(Constants.USR_ACC,Constants.USR_PWD);  
27 - String token =OpenIdTest.bindWithOpenIdAndLoginAndGetToken(Constants.USR_OPENID,Constants.USR_OPENID_TYPE); 25 + public static void init() {
  26 +
  27 +// String token = OpenIdTest.bindWithOpenIdAndLoginAndGetToken(Constants.USR_OPENID, Constants.USR_OPENID_TYPE);
  28 + token = loginAndGetToken(Constants.USR_ACC, Constants.USR_PWD);
  29 +// String token =OpenIdTest.bindWithOpenIdAndLoginAndGetToken(Constants.USR_OPENID,Constants.USR_OPENID_TYPE);
28 } 30 }
29 31
30 /** 32 /**
31 * 体检报告列表查询接口 33 * 体检报告列表查询接口
32 */ 34 */
33 @Test 35 @Test
34 - public void testList(){  
35 - Map<String,String> params = new HashMap<String, String>();  
36 - params.put("t",HttpTools.getNow());  
37 - params.put("type",Constants.KEY_ID);  
38 - params.put("sign",HttpTools.getSign(params));  
39 - String response = HttpTools.requestByMapWithToken(URL_REPORT_LIST,"GET",params,token); 36 + public void testList() {
  37 + Map<String, String> params = new HashMap<String, String>();
  38 + params.put("t", HttpTools.getNow());
  39 + params.put("type", Constants.KEY_ID);
  40 + params.put("sign", HttpTools.getSign(params));
  41 + String response = HttpTools.requestByMapWithToken(URL_REPORT_LIST, "GET", params, token);
40 System.out.println(response); 42 System.out.println(response);
41 } 43 }
42 44
@@ -44,13 +46,13 @@ public class ReportTest { @@ -44,13 +46,13 @@ public class ReportTest {
44 * 体检报告详情查询接口 46 * 体检报告详情查询接口
45 */ 47 */
46 @Test 48 @Test
47 - public void testDetail(){  
48 - Map<String,String> params = new HashMap<String, String>();  
49 - params.put("report_id","141");  
50 - params.put("t",HttpTools.getNow());  
51 - params.put("type",Constants.KEY_ID);  
52 - params.put("sign",HttpTools.getSign(params));  
53 - String response = HttpTools.requestByMapWithToken(URL_REPORT_DETAIL,"GET",params,token); 49 + public void testDetail() {
  50 + Map<String, String> params = new HashMap<String, String>();
  51 + params.put("report_id", "141");
  52 + params.put("t", HttpTools.getNow());
  53 + params.put("type", Constants.KEY_ID);
  54 + params.put("sign", HttpTools.getSign(params));
  55 + String response = HttpTools.requestByMapWithToken(URL_REPORT_DETAIL, "GET", params, token);
54 System.out.println(response); 56 System.out.println(response);
55 } 57 }
56 58
@@ -58,15 +60,15 @@ public class ReportTest { @@ -58,15 +60,15 @@ public class ReportTest {
58 * 体检报告指标解释查询接口 60 * 体检报告指标解释查询接口
59 */ 61 */
60 @Test 62 @Test
61 - public void testItemInfo(){  
62 - Map<String,String> params = new HashMap<String, String>();  
63 - params.put("itemId","10");  
64 - params.put("status","2");  
65 - params.put("isPureHtml","false");  
66 - params.put("t",HttpTools.getNow());  
67 - params.put("type",Constants.KEY_ID);  
68 - params.put("sign",HttpTools.getSign(params));  
69 - String response = HttpTools.requestByMapWithToken(URL_ITEM_INFO,"GET",params,token); 63 + public void testItemInfo() {
  64 + Map<String, String> params = new HashMap<String, String>();
  65 + params.put("itemId", "10");
  66 + params.put("status", "2");
  67 + params.put("isPureHtml", "false");
  68 + params.put("t", HttpTools.getNow());
  69 + params.put("type", Constants.KEY_ID);
  70 + params.put("sign", HttpTools.getSign(params));
  71 + String response = HttpTools.requestByMapWithToken(URL_ITEM_INFO, "GET", params, token);
70 System.out.println(response); 72 System.out.println(response);
71 } 73 }
72 74
@@ -74,15 +76,15 @@ public class ReportTest { @@ -74,15 +76,15 @@ public class ReportTest {
74 * 体检报告指标解释查询接口(过滤html标签) 76 * 体检报告指标解释查询接口(过滤html标签)
75 */ 77 */
76 @Test 78 @Test
77 - public void testItemInfoPureHtml(){  
78 - Map<String,String> params = new HashMap<String, String>();  
79 - params.put("itemId","10");  
80 - params.put("status","1");  
81 - params.put("isPureHtml","true");  
82 - params.put("t",HttpTools.getNow());  
83 - params.put("type",Constants.KEY_ID);  
84 - params.put("sign",HttpTools.getSign(params));  
85 - String response = HttpTools.requestByMapWithToken(URL_ITEM_INFO,"GET",params,token); 79 + public void testItemInfoPureHtml() {
  80 + Map<String, String> params = new HashMap<String, String>();
  81 + params.put("itemId", "10");
  82 + params.put("status", "1");
  83 + params.put("isPureHtml", "true");
  84 + params.put("t", HttpTools.getNow());
  85 + params.put("type", Constants.KEY_ID);
  86 + params.put("sign", HttpTools.getSign(params));
  87 + String response = HttpTools.requestByMapWithToken(URL_ITEM_INFO, "GET", params, token);
86 System.out.println(response); 88 System.out.println(response);
87 } 89 }
88 90
@@ -90,15 +92,15 @@ public class ReportTest { @@ -90,15 +92,15 @@ public class ReportTest {
90 * 体检报告指标曲线查询接口 92 * 体检报告指标曲线查询接口
91 */ 93 */
92 @Test 94 @Test
93 - public void testItemGraph(){  
94 - Map<String,String> params = new HashMap<String, String>();  
95 - params.put("itemId","10");  
96 - params.put("stime","2010-01-01 10:32:00");  
97 - params.put("etime","2019-12-22 10:32:00");  
98 - params.put("t",HttpTools.getNow());  
99 - params.put("type",Constants.KEY_ID);  
100 - params.put("sign",HttpTools.getSign(params));  
101 - String response = HttpTools.requestByMapWithToken(URL_ITEM_GRAPH,"GET",params,token); 95 + public void testItemGraph() {
  96 + Map<String, String> params = new HashMap<String, String>();
  97 + params.put("itemId", "10");
  98 + params.put("stime", "2010-01-01 10:32:00");
  99 + params.put("etime", "2019-12-22 10:32:00");
  100 + params.put("t", HttpTools.getNow());
  101 + params.put("type", Constants.KEY_ID);
  102 + params.put("sign", HttpTools.getSign(params));
  103 + String response = HttpTools.requestByMapWithToken(URL_ITEM_GRAPH, "GET", params, token);
102 System.out.println(response); 104 System.out.println(response);
103 } 105 }
104 106
@@ -106,13 +108,13 @@ public class ReportTest { @@ -106,13 +108,13 @@ public class ReportTest {
106 * 微信端体检报告分年龄比较接口 108 * 微信端体检报告分年龄比较接口
107 */ 109 */
108 @Test 110 @Test
109 - public void testCompare(){  
110 - Map<String,String> params = new HashMap<String, String>();  
111 - params.put("report_id","77");  
112 - params.put("t",HttpTools.getNow());  
113 - params.put("type",Constants.KEY_ID);  
114 - params.put("sign",HttpTools.getSign(params));  
115 - String response = HttpTools.requestByMapWithToken(URL_COMPARE,"POST",params,token); 111 + public void testCompare() {
  112 + Map<String, String> params = new HashMap<String, String>();
  113 + params.put("report_id", "77");
  114 + params.put("t", HttpTools.getNow());
  115 + params.put("type", Constants.KEY_ID);
  116 + params.put("sign", HttpTools.getSign(params));
  117 + String response = HttpTools.requestByMapWithToken(URL_COMPARE, "POST", params, token);
116 System.out.println(response); 118 System.out.println(response);
117 } 119 }
118 } 120 }
@@ -15,7 +15,6 @@ import java.text.DecimalFormat; @@ -15,7 +15,6 @@ import java.text.DecimalFormat;
15 * Created by zhao yue on 2017/1/14. 15 * Created by zhao yue on 2017/1/14.
16 */ 16 */
17 public class Data { 17 public class Data {
18 - public static final String USR_ACCOUNT = "15211112222";  
19 public static String AMP_REPORT = ""; 18 public static String AMP_REPORT = "";
20 19
21 20
@@ -12,11 +12,6 @@ import java.text.DecimalFormat; @@ -12,11 +12,6 @@ import java.text.DecimalFormat;
12 * Created by zhao yue on 2017/1/14. 12 * Created by zhao yue on 2017/1/14.
13 */ 13 */
14 public class Data { 14 public class Data {
15 - // admin account  
16 - public static final String ADMIN_ACCOUNT = "user1";  
17 - // admin password  
18 - public static final String ADMIN_PWD = "pass1";  
19 - public static final String USR_ACCOUNT = "15211112222";  
20 // "{\"ABD\":\"35.66\",\"LAC\":\"36.23\",\"LCA\":\"32.94\",\"RAC\":\"35.84\",\"RCA\":\"33.05\",\"age\":\"24\",\"atmospheric_pressure\":\"756.58\",\"basic_result\":\"初步检测结果(仅供参考):\\n\\n低渗性血管张力异常 \\n\\n有必要排除血凝异常 血凝升高 \\n\\n建议向胃肠病专家(精于胃十二指肠炎)进一步咨询 \\n\\n血管张力异常,静脉循环障碍 酒精性高血压 \\n\\n第三脑室宽度=6.42 \\n\\n建议向妇科医生进一步咨询 其它器官血流量占=4.1 \\n\\nTiffeneau指数持续减少83.6 (Tiffeneau测试) \\n\\n----------------------------------------------------------------------------------------------------------\\n\\n\\n\",\"basic_result_ids\":[1,2,3,4],\"detail\":{\"1\":\"117.54\",\"10\":\"01.29\",\"100\":\"5.06\",\"101\":\"250.60\",\"102\":\"8.61\",\"103\":\"0.319\",\"104\":\"370.02\",\"105\":\"45.98\",\"106\":\"62.96\",\"107\":\"325.68\",\"108\":\"3.750\",\"109\":\"71.52\",\"11\":\"02.13\",\"110\":\"0.136\",\"111\":\"0.392\",\"112\":\"0.079\",\"113\":\"67.78\",\"114\":\"113.66\",\"115\":\"71.55\",\"116\":\"6.42\",\"117\":\"0.91\",\"118\":\"78.4\",\"119\":\"66.0\",\"12\":\"245.28\",\"120\":\"31\",\"121\":\"90\",\"122\":\"340\",\"123\":\"0.93\",\"124\":\"0.97\",\"125\":\"15\",\"13\":\"2.45\",\"14\":\"0.86\",\"15\":\"4.06\",\"16\":\"134.78\",\"17\":\"1.56\",\"18\":\"7.33\",\"19\":\"5.18\",\"2\":\"3.81\",\"20\":\"42.62\",\"21\":\"5.21\",\"22\":\"0.26\",\"23\":\"0.26\",\"24\":\"13.12\",\"25\":\"14.87\",\"26\":\"1.01\",\"27\":\"10.52\",\"28\":\"2.83\",\"29\":\"7.69\",\"3\":\"36.87\",\"30\":\"61.82\",\"31\":\"82.57\",\"32\":\"28.00\",\"33\":\"1.41\",\"34\":\"5.53\",\"35\":\"5.00\",\"36\":\"38.19\",\"37\":\"4.01\",\"38\":\"2.34\",\"39\":\"0.30\",\"4\":\"7.34\",\"40\":\"1.13\",\"41\":\"0.80\",\"42\":\"4.77\",\"43\":\"14.55\",\"44\":\"21.39\",\"45\":\"40.28\",\"46\":\"56.21\",\"47\":\"8.04\",\"48\":\"162.71\",\"49\":\"75.6\",\"5\":\"46.70\",\"50\":\"25.41\",\"51\":\"86.24\",\"52\":\"251.45\",\"53\":\"0.0050\",\"54\":\"1.68\",\"55\":\"475.35\",\"56\":\"35.47\",\"57\":\"3.8396\",\"58\":\"1052.84\",\"59\":\"64.17\",\"6\":\"5.07\",\"60\":\"3.82\",\"61\":\"265.63\",\"62\":\"3953.54\",\"63\":\"58.44\",\"64\":\"4.52\",\"65\":\"18.93\",\"66\":\"14.01\",\"67\":\"25.61\",\"68\":\"26.05\",\"69\":\"6.66\",\"7\":\"5.36\",\"70\":\"4.08\",\"71\":\"261.67\",\"72\":\"1209.45\",\"73\":\"819.37\",\"74\":\"2134.08\",\"75\":\"1726.00\",\"76\":\"421.24\",\"77\":\"265.40\",\"78\":\"140.33\",\"79\":\"72.37\",\"8\":\"7.35\",\"80\":\"19.51\",\"81\":\"4.78\",\"82\":\"53.24\",\"83\":\"3.94\",\"84\":\"3.19\",\"85\":\"160.94\",\"86\":\"2.22\",\"87\":\"80.94\",\"88\":\"34.53\",\"89\":\"3607.41\",\"9\":\"3.72\",\"90\":\"7.38\",\"91\":\"1922.57\",\"92\":\"85.16\",\"93\":\"83.59\",\"94\":\"71.95\",\"95\":\"6.64\",\"96\":\"0.96\",\"97\":\"1135.53\",\"98\":\"2.48\",\"99\":\"96.97\"},\"name\":\"测试\",\"number\":\"12345678901\",\"pulse\":\"79\",\"report_date\":\"2014-12-17 17:01:40\",\"respiratory_rate\":\"18\",\"sex\":0,\"stable\":\"99999\",\"total\":\"173.62\",\"weight\":\"45\",\"title\":\"AMP TITLE\",\"account\":\"user1\",\"machine_num\":\"10311212\"}"; 15 // "{\"ABD\":\"35.66\",\"LAC\":\"36.23\",\"LCA\":\"32.94\",\"RAC\":\"35.84\",\"RCA\":\"33.05\",\"age\":\"24\",\"atmospheric_pressure\":\"756.58\",\"basic_result\":\"初步检测结果(仅供参考):\\n\\n低渗性血管张力异常 \\n\\n有必要排除血凝异常 血凝升高 \\n\\n建议向胃肠病专家(精于胃十二指肠炎)进一步咨询 \\n\\n血管张力异常,静脉循环障碍 酒精性高血压 \\n\\n第三脑室宽度=6.42 \\n\\n建议向妇科医生进一步咨询 其它器官血流量占=4.1 \\n\\nTiffeneau指数持续减少83.6 (Tiffeneau测试) \\n\\n----------------------------------------------------------------------------------------------------------\\n\\n\\n\",\"basic_result_ids\":[1,2,3,4],\"detail\":{\"1\":\"117.54\",\"10\":\"01.29\",\"100\":\"5.06\",\"101\":\"250.60\",\"102\":\"8.61\",\"103\":\"0.319\",\"104\":\"370.02\",\"105\":\"45.98\",\"106\":\"62.96\",\"107\":\"325.68\",\"108\":\"3.750\",\"109\":\"71.52\",\"11\":\"02.13\",\"110\":\"0.136\",\"111\":\"0.392\",\"112\":\"0.079\",\"113\":\"67.78\",\"114\":\"113.66\",\"115\":\"71.55\",\"116\":\"6.42\",\"117\":\"0.91\",\"118\":\"78.4\",\"119\":\"66.0\",\"12\":\"245.28\",\"120\":\"31\",\"121\":\"90\",\"122\":\"340\",\"123\":\"0.93\",\"124\":\"0.97\",\"125\":\"15\",\"13\":\"2.45\",\"14\":\"0.86\",\"15\":\"4.06\",\"16\":\"134.78\",\"17\":\"1.56\",\"18\":\"7.33\",\"19\":\"5.18\",\"2\":\"3.81\",\"20\":\"42.62\",\"21\":\"5.21\",\"22\":\"0.26\",\"23\":\"0.26\",\"24\":\"13.12\",\"25\":\"14.87\",\"26\":\"1.01\",\"27\":\"10.52\",\"28\":\"2.83\",\"29\":\"7.69\",\"3\":\"36.87\",\"30\":\"61.82\",\"31\":\"82.57\",\"32\":\"28.00\",\"33\":\"1.41\",\"34\":\"5.53\",\"35\":\"5.00\",\"36\":\"38.19\",\"37\":\"4.01\",\"38\":\"2.34\",\"39\":\"0.30\",\"4\":\"7.34\",\"40\":\"1.13\",\"41\":\"0.80\",\"42\":\"4.77\",\"43\":\"14.55\",\"44\":\"21.39\",\"45\":\"40.28\",\"46\":\"56.21\",\"47\":\"8.04\",\"48\":\"162.71\",\"49\":\"75.6\",\"5\":\"46.70\",\"50\":\"25.41\",\"51\":\"86.24\",\"52\":\"251.45\",\"53\":\"0.0050\",\"54\":\"1.68\",\"55\":\"475.35\",\"56\":\"35.47\",\"57\":\"3.8396\",\"58\":\"1052.84\",\"59\":\"64.17\",\"6\":\"5.07\",\"60\":\"3.82\",\"61\":\"265.63\",\"62\":\"3953.54\",\"63\":\"58.44\",\"64\":\"4.52\",\"65\":\"18.93\",\"66\":\"14.01\",\"67\":\"25.61\",\"68\":\"26.05\",\"69\":\"6.66\",\"7\":\"5.36\",\"70\":\"4.08\",\"71\":\"261.67\",\"72\":\"1209.45\",\"73\":\"819.37\",\"74\":\"2134.08\",\"75\":\"1726.00\",\"76\":\"421.24\",\"77\":\"265.40\",\"78\":\"140.33\",\"79\":\"72.37\",\"8\":\"7.35\",\"80\":\"19.51\",\"81\":\"4.78\",\"82\":\"53.24\",\"83\":\"3.94\",\"84\":\"3.19\",\"85\":\"160.94\",\"86\":\"2.22\",\"87\":\"80.94\",\"88\":\"34.53\",\"89\":\"3607.41\",\"9\":\"3.72\",\"90\":\"7.38\",\"91\":\"1922.57\",\"92\":\"85.16\",\"93\":\"83.59\",\"94\":\"71.95\",\"95\":\"6.64\",\"96\":\"0.96\",\"97\":\"1135.53\",\"98\":\"2.48\",\"99\":\"96.97\"},\"name\":\"测试\",\"number\":\"12345678901\",\"pulse\":\"79\",\"report_date\":\"2014-12-17 17:01:40\",\"respiratory_rate\":\"18\",\"sex\":0,\"stable\":\"99999\",\"total\":\"173.62\",\"weight\":\"45\",\"title\":\"AMP TITLE\",\"account\":\"user1\",\"machine_num\":\"10311212\"}";
21 public static String AMP_REPORT = ""; 16 public static String AMP_REPORT = "";
22 17
@@ -37,7 +37,7 @@ public class UsrAccountTest { @@ -37,7 +37,7 @@ public class UsrAccountTest {
37 public void testAccountExistVerify() { 37 public void testAccountExistVerify() {
38 String token = loginAndGetToken(Constants.ADMIN_ACCOUNT, Constants.ADMIN_PWD); 38 String token = loginAndGetToken(Constants.ADMIN_ACCOUNT, Constants.ADMIN_PWD);
39 Map<String, String> params = new HashMap<String, String>(); 39 Map<String, String> params = new HashMap<String, String>();
40 - params.put("usraccount", Data.USR_ACCOUNT); 40 + params.put("usraccount", Constants.USR_ACC);
41 String response = HttpTools.requestByMapWithToken(URL_USER, "GET", params, token); 41 String response = HttpTools.requestByMapWithToken(URL_USER, "GET", params, token);
42 System.out.println("verify status:" + response); 42 System.out.println("verify status:" + response);
43 } 43 }
@@ -47,7 +47,7 @@ public class UsrAccountTest { @@ -47,7 +47,7 @@ public class UsrAccountTest {
47 public void testAccountNotExist() { 47 public void testAccountNotExist() {
48 String token = loginAndGetToken(Constants.ADMIN_ACCOUNT, Constants.ADMIN_PWD); 48 String token = loginAndGetToken(Constants.ADMIN_ACCOUNT, Constants.ADMIN_PWD);
49 Map<String, String> params = new HashMap<String, String>(); 49 Map<String, String> params = new HashMap<String, String>();
50 - params.put("usraccount", Data.USR_ACCOUNT + "not exist account"); 50 + params.put("usraccount",Constants.USR_ACC + "not exist account");
51 String response = HttpTools.requestByMapWithToken(URL_USER, "GET", params, token); 51 String response = HttpTools.requestByMapWithToken(URL_USER, "GET", params, token);
52 System.out.println("verify status:" + response); 52 System.out.println("verify status:" + response);
53 } 53 }