DataShareTest.java
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package com.xkl.datashare;
import com.xkl.Constants;
import com.xkl.HttpTools;
import com.xkl.RtnCodeTools;
import org.junit.Assert;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
/**
* Created by win7 on 2017/3/19.
*/
public class DataShareTest {
private static final String DataShare_REPORT_LIST = Constants.URL_PREFIX + "/dataShare/list";
private static final String DataShare_REPORT_DETAIL = Constants.URL_PREFIX + "/dataShare/detail";
/**
* 数据共享-体检报告列表查询接口
*/
@Test
public void testDataShareList() {
Map<String, String> params = new HashMap<String, String>();
params.put("t", HttpTools.getNow());
params.put("type", Constants.KEY_ID);
params.put("sign", HttpTools.getSign(params));
String response = HttpTools.requestByMap(DataShare_REPORT_LIST, "GET", params);
Assert.assertTrue(RtnCodeTools.verifyCode(response, Constants.CODE_SUCC));
System.out.println(response);
}
/**
* 数据共享-体检报告详情查询接口
*/
@Test
public void testDataShareDetail() {
Map<String, String> params = new HashMap<String, String>();
params.put("report_id", "77");
params.put("t", HttpTools.getNow());
params.put("type", Constants.KEY_ID);
params.put("sign", HttpTools.getSign(params));
String response = HttpTools.requestByMap(DataShare_REPORT_DETAIL, "GET", params);
Assert.assertTrue(RtnCodeTools.verifyCode(response, Constants.CODE_SUCC));
System.out.println(response);
}
/**
* 数据共享-体检报告详情查询接口(报告所属的公司信息有误)
*/
@Test
public void testDataShareDetail_WrongCompany() {
Map<String, String> params = new HashMap<String, String>();
params.put("report_id", "119");
params.put("t", HttpTools.getNow());
params.put("type", Constants.KEY_ID);
params.put("sign", HttpTools.getSign(params));
String response = HttpTools.requestByMap(DataShare_REPORT_DETAIL, "GET", params);
Assert.assertTrue(RtnCodeTools.verifyCode(response, Constants.COMPANY_ERROR));
System.out.println(response);
}
}