TestCase.java
2.47 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.pipi.qa;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;
import com.pipi.qa.framework.tools.HttpToolKit;
public class TestCase {
private Logger logger = LoggerFactory.getLogger(TestCase.class);
/**
@Test
public void test13() {
saveProjectInfoByUtilsService = new SaveProjectInfoByUtilsServiceImpl();
com.alibaba.fastjson.JSONObject jsonObject = saveProjectInfoByUtilsService.queryProjectInfo(0, 10, 0,0);
}
@Test
public void test14() {
saveProjectInfoByUtilsService = new SaveProjectInfoByUtilsServiceImpl();
((SaveProjectInfoByUtilsServiceImpl) saveProjectInfoByUtilsService).queryCity();
}
@Test
public void test15() {
saveProjectInfoByUtilsService = new SaveProjectInfoByUtilsServiceImpl();
((SaveProjectInfoByUtilsServiceImpl) saveProjectInfoByUtilsService).queryTown(null);
}
*/
public Map<String,String> getParam() {
String s = "http://ip:port/extername/get_account_trade_record.json?page_size=20&page_index=1&user_id=203317&trade_type=0";
Map<String, String> map = new HashMap<>();
if (s.contains("?")) {
String[] split = s.split("\\?");
if (split[1].contains("&")) {
String[] split1 = split[1].split("&");
for (String value : split1) {
if (value.contains("=")) {
String[] split2 = value.split("=");
map.put(split2[0], split2[1]);
}
}
}else {
String[] split1 = split[1].split("=");
map.put(split1[0], split1[1]);
}
}
System.out.println(map);
return map;
}
public void login(String mobile){
String url = "https://t4-api-app.apeiwan.com/login";
String smsUrl = "https://t4-api-app.apeiwan.com/sms/verify";
Map<String, Object> params = new HashMap();
Map<String, Object> SmsParams = new HashMap();
SmsParams.put("mobile", mobile);
//获取验证码
HttpToolKit.invokePost(smsUrl, null, SmsParams);
params.put("mobile", mobile);
params.put("code", 2222);
//登录
HttpToolKit.invokePost(url, null, params );
}
public static void main(String args[]){
TestCase TestCase = new TestCase();
//TestCase.getParam();
TestCase.login("13823774131");
}
}