Commit 826f229d authored by 赵然's avatar 赵然

zr

parents 027eeafe 81f452ba
......@@ -32,7 +32,7 @@ public class 设置_应用信息_DuibaTest extends AbstractTestNGSpringContextTe
updateAppInfoService.UpdateAppInfo(appId,unitName,earnCreditsUrl,creditsDetailUrl,isDecimalOpen);
Response response2= updateAppInfoService.appInfo(appId);
Assert.assertEquals(response2.jsonPath().getString("data.name"), "(saas)接口自动化应用", "校验应用名称失败");
Assert.assertEquals(response2.jsonPath().getString("data.name"), "(saas自动化)至尊版", "校验应用名称失败");
Assert.assertEquals(response2.jsonPath().getString("data.earnCreditsLetter"), "积分文案&2", "校验积分文案失败");
Assert.assertEquals(response2.jsonPath().getString("data.creditsDetailUrl"), "https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&tn=baidu&wd=www.baidu.com", "校验积分明细链接失败");
logger.info("保存应用信息成功");
......
......@@ -249,6 +249,7 @@ public class Authorization {
public Map hdLoginSaas(String appId){
int i=10;
logger.info("hdCookiesSaasByApp cookies:"+hdCookiesSaasByApp.toString());
Map<String,String> hdCookies = hdCookiesSaasByApp.get(appId);
while((hdCookies==null||hdCookies.size()==0)&&i>0) {
Response token=this.hdGetToken();
......@@ -260,16 +261,21 @@ public class Authorization {
paras.put("redirect", "/redirectApp");
paras.put("isAutoLogin", "true");
Response response = given().cookies(cookies).params(paras).post(url);
Map<String,String> map = response.getCookies();
logger.info("cookies:"+map.toString());
hdCookies=new HashMap<>(response.getCookies());
//取消安全校验
hdCookies.remove("csrf_token");
hdCookies.put("appId",appId);
hdCookies.put("duibaAppId",appId);
hdCookiesSaasByApp.put(appId,hdCookies);
if(hdCookies!=null||hdCookies.size()!=0) {
//取消安全校验
hdCookies.remove("csrf_token");
hdCookies.put("appId", appId);
hdCookies.put("duibaAppId", appId);
logger.info("cookies2:"+hdCookies.toString());
hdCookiesSaasByApp.put(appId,hdCookies);
}
i--;
}
return hdCookies;
}
//密码为duibaduiba123
......@@ -287,7 +293,7 @@ public class Authorization {
paras.put("isAutoLogin", "true");
Response response = given().cookies(cookies).params(paras).post(url);
hdCookies=new HashMap<>(response.getCookies());
if(hdCookies==null||hdCookies.size()==0){
if(hdCookies!=null||hdCookies.size()!=0){
hdCookies.remove("csrf_token");
hdCookiesCommon.put(email,hdCookies);
}
......@@ -317,7 +323,7 @@ public class Authorization {
Response response = given().cookies(cookies).params(paras).post(url);
response.prettyPrint();
hdCookies=new HashMap<>(response.getCookies());
if(hdCookies==null||hdCookies.size()==0){
if(hdCookies!=null||hdCookies.size()!=0){
hdCookies.remove("csrf_token");
hdCookiesCommon.put(account,hdCookies);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment