|
|
package com.xkl;
|
|
|
package com.xkl.partner;
|
|
|
|
|
|
import com.xkl.Constants;
|
|
|
import com.xkl.EncodeTools;
|
|
|
import com.xkl.HttpTools;
|
|
|
import com.xkl.RtnCodeTools;
|
|
|
import org.junit.Assert;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import static com.xkl.TokenTest.loginAndGetToken;
|
|
|
|
|
|
/**
|
|
|
* Created by win7 on 2016/12/25.
|
|
|
* 用户注册、修改密码、获取个人信息
|
...
|
...
|
@@ -79,7 +81,7 @@ public class UserInfoTest { |
|
|
params.put("type", Constants.KEY_ID);
|
|
|
params.put("sign", HttpTools.getSign(params));
|
|
|
//获取token
|
|
|
String token = loginAndGetToken("15211112222", "pass152_new");
|
|
|
String token = TokenTest.loginAndGetToken("15211112222", "pass152_new");
|
|
|
System.out.println(token);
|
|
|
String response = HttpTools.requestByMapWithToken(URL_USER, "PUT", params, token);
|
|
|
Assert.assertTrue(RtnCodeTools.verifyCode(response, Constants.USER_MODPASS_LOGOUT));
|
...
|
...
|
@@ -96,7 +98,7 @@ public class UserInfoTest { |
|
|
params.put("type", Constants.KEY_ID);
|
|
|
params.put("sign", HttpTools.getSign(params));
|
|
|
//获取token
|
|
|
String token = loginAndGetToken(Constants.USR_ACC, Constants.USR_PWD);
|
|
|
String token = TokenTest.loginAndGetToken(Constants.USR_ACC, Constants.USR_PWD);
|
|
|
System.out.println(token);
|
|
|
String response = HttpTools.requestByMapWithToken(URL_USER, "GET", params, token);
|
|
|
Assert.assertTrue(RtnCodeTools.verifyCode(response, Constants.CODE_SUCC));
|
...
|
...
|
|