Commit 2bf938ac authored by 赵然's avatar 赵然

zr

parents 4d531c8b e852d374
package http.cases.ConcurrentTest;
import base.DuibaTestBase;
import http.service.Authorization;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.*;
import static io.restassured.RestAssured.given;
/**
* Created by mabo on 2019/8/28
*/
public class 集卡_ConcurrentTest extends DuibaTestBase {
private String url = "http://activity.m.duibatest.com.cn";
@Autowired
Authorization authorization;
private int uid=2691;
private String collectRuleId = "5193";
private List<String> responselist = new ArrayList();
@BeforeClass
public void beforeclass(){
try{
jdbc.update("UPDATE collect_card_consumer.tb_collect_card_info_0614 set item_count=1 where item_id=32675");
jdbc.update("UPDATE collect_card_consumer.tb_collect_card_info_0614 set item_count=1 where item_id=32674");
}catch (Exception e){
e.printStackTrace();
}
}
@Test(threadPoolSize=5, invocationCount=5)
public void 卡片库存不足并发() throws InterruptedException {
Map<String,String> map = new HashMap<>();
map.put("collectRuleId",collectRuleId);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(url+"/plugin/collectRule/openCollectGoodsPrize");
String result = response.asString();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
System.out.println(df.format(new Date()));
synchronized (this){
Thread.sleep(5000);
responselist.add(result);
}
System.out.println(df.format(new Date()));
}
@Test(dependsOnMethods = "卡片库存不足并发")
public void 校验() throws SQLException {
int i=0;
int j=0;
for (String s:
responselist) {
if(s.contains("重复下单"))i++;
if(s.contains("orderId"))j++;
}
Assert.assertEquals(i,4);
Assert.assertEquals(j,1);
logger.info("校验并发结果集正确");
Map map = jdbc.findSimpleResult("select * from collect_card_consumer.tb_collect_card_info_0614 where item_id=32674");
int count = (int)map.get("item_count");
Assert.assertEquals(count,0);
map = jdbc.findSimpleResult("select * from collect_card_consumer.tb_collect_card_info_0614 where item_id=32675");
count = (int)map.get("item_count");
Assert.assertEquals(count,0);
logger.info("校验卡片库存正确");
}
@Test
public void test(){
}
}
......@@ -14,9 +14,9 @@ public class Database {
public static String orders10 = "orders_0411";
public static String orders11 = "orders_0182";
public static String orders12 = "orders_0715";
public static String orders13 = "orders_0717";
public static String orders13 = "orders_0411";
public static String orders14 = "orders_0712";
public static String orders15 = "orders_0718";
public static String orders15 = "orders_0063";
public static String orders16 = "orders_0721";
......
......@@ -164,7 +164,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
logger.info("用户成功兑换一次");
//再次兑换
Thread.sleep(3000);
Thread.sleep(4000);
try{
response = gawService.phonebillExchange(uid,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
......@@ -194,10 +194,10 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
Date date=new Date();
Calendar calendar=Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, -30);
calendar.add(Calendar.DAY_OF_MONTH, -31);
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
logger.info("当前时间-30天:" + dateFormat.format(calendar.getTime()));
logger.info("当前时间-31天:" + dateFormat.format(calendar.getTime()));
//更新表记录,修改记录为前一个月
String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 1 and consumer_id = 100152008 ORDER BY id DESC LIMIT 1";
......@@ -273,9 +273,9 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
public void 话费用户id篡改测试() throws Exception{
//商品: lv测试应用77
//uid1: 大富翁app
//uid1: lv测试应用55
//uid2: lv测试应用88
int uid1 = 7085;
int uid1 = 7022;
int uid2 = 7292;
String actualCredits = "5";
String degreeId = "10";
......@@ -297,7 +297,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
logger.info("订单积分:" + orderCredits);
Assert.assertEquals(orderStatus,"consume_success","校验status失败");
Assert.assertEquals(orderappId,"1","校验appId失败");
Assert.assertEquals(orderappId,"22561","校验appId失败");
Assert.assertEquals(orderCredits,"1000","校验credits失败");
logger.info("校验话费用户id1篡改兑换成功");
......
......@@ -198,13 +198,13 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
Date date=new Date();
Calendar calendar=Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, -30);
calendar.add(Calendar.DAY_OF_MONTH, -31);
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
logger.info("当前时间-30天:" + dateFormat.format(calendar.getTime()));
logger.info("当前时间-31天:" + dateFormat.format(calendar.getTime()));
//更新表记录,修改记录为前一个月
String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 55 and consumer_id = 100152011 ORDER BY id DESC LIMIT 1";
String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 55 and consumer_id = 100152011 and sub_key = 3 ORDER BY id DESC LIMIT 1";
jdbc.update(sql);
......@@ -306,9 +306,9 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
public void 支付宝用户id篡改测试() throws Exception{
//商品: lv测试应用77
//uid1: 大富翁app
//uid1: lv测试应用55
//uid2: lv测试应用88
int uid1 = 7204;
int uid1 = 6866;
int uid2 = 7291;
String actualCredits = "10";
String degreeId = "10";
......@@ -316,7 +316,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
String credits = "10";
String message = "";
//支付宝兑换, 大富翁app已上架支付宝
//支付宝兑换, lv测试应用55已上架支付宝
Response response = gawService.alipayExchange(uid1,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId");
......@@ -330,7 +330,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
logger.info("订单积分:" + orderCredits);
Assert.assertEquals(orderStatus,"consume_success","校验status失败");
Assert.assertEquals(orderappId,"1","校验appId失败");
Assert.assertEquals(orderappId,"22561","校验appId失败");
Assert.assertEquals(orderCredits,"1000","校验credits失败");
logger.info("校验支付宝用户id1篡改兑换成功");
......
......@@ -71,6 +71,7 @@ public class 修改兑吧商品_ExchangeTest extends DuibaTestBase {
//编辑
doUpdateAppItemService.doUpdateAppItem(appId,appItemId,title,"10","coupon","31658");
Response response2=developerObjectService.editAppItem2(appItemId);
System.out.println(response2.asString());
Assert.assertEquals(response2.jsonPath().getString("data.title"), "【SaaS-自动化测试】优惠券勿动", "校验兑吧优惠券商品标题失败");
Assert.assertEquals(response2.jsonPath().getString("data.credits"), "10", "校验兑吧优惠券商品失败");
......
......@@ -489,6 +489,11 @@ public class 新集卡_开奖流程_DuibaTest extends DuibaTestBase {
}
return statusResponse;
}
// @Test
public void test() throws Exception {
Response response = openPrize("5193",2691,"nomal");
response.prettyPrint();
}
......
......@@ -171,6 +171,7 @@ public class 秒杀自有老虚拟商品_兑换限制_SeckillTest extends DuibaT
queryResponse.prettyPrint();
// if(queryResponse.asString().contains("好可惜,没抢到"))return;
String orderId = MatcherString.getString(queryResponse.asString(),"orderId: '(.*?)'",1);
......
package http.cases.SignTest;
import base.DuibaTestBase;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import http.service.Activity.ManagerService;
import http.service.Authorization;
import http.service.hd.SigninService;
......@@ -12,10 +14,9 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
public class ContractSign_Cash_signTest extends DuibaTestBase {
@Autowired
......@@ -175,11 +176,44 @@ public class ContractSign_Cash_signTest extends DuibaTestBase {
Assert.assertEquals(doneStatus, "WAIT_REWARD", "当前期次完成状态不正确");
String winCount = recordRes.jsonPath().getString("data.list[0].winCount");
Assert.assertEquals(winCount, "33333", "瓜分奖励金额不正确");
//领奖
Response rewardRes = ContractSignService.getReward(contractId1,uid1);
String rewardStatus = rewardRes.jsonPath().getString("success");
String rewardAmount = rewardRes.jsonPath().getString("data");
//领奖-并发
CountDownLatch latch = new CountDownLatch(5);
List<String> list = new CopyOnWriteArrayList();
for (int i = 0; i < 5; i++) {
new Thread(() -> {
try {
Response rewardRes = ContractSignService.getReward(contractId1,uid1);
list.add(rewardRes.asString());
} catch (Exception e) {
e.printStackTrace();
}
latch.countDown();
}).start();
}
latch.await();
int fail=0,success=0;
JSONObject json=null;
for (String s:
list) {
if(s.contains("操作太频繁啦,稍后再试")){
fail++;
}else{
success++;
json = JSON.parseObject(s);
}
}
String rewardAmount = json.getString("data");
String rewardStatus = json.getString("success");
Assert.assertEquals(rewardStatus,"true","领取奖励结果不正确");
Assert.assertEquals(rewardAmount,winCount,"领取奖励金额不正确");
Assert.assertEquals(fail,4);
}
}
......@@ -14,10 +14,8 @@ import io.restassured.response.Response;
import java.net.SocketImpl;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutionException;
import utils.RedisUtil;
......@@ -361,7 +359,27 @@ public class ContractSign_Multi_signTest extends DuibaTestBase {
rewardRes = ContractSignService.getReward(contractId4,uid4);
rewardCount = rewardRes.jsonPath().getInt("data");
Assert.assertEquals(rewardCount, 4125, "uid4领取奖励数不正确");
List<String> list = new CopyOnWriteArrayList<>();
// uid6领奖
// for (int i = 0; i < 20; i++) {
// new Thread(() -> {
// try {
// Response rewardRess = ContractSignService.getReward(contractId6, uid6);
// list.add(rewardRess.asString());
// } catch (Exception e) {
// e.printStackTrace();
// }
//
//
// }).start();
//
// }
// Thread.sleep(20000);
// for (String s:
// list) {
// System.out.println(s);
// }
rewardRes = ContractSignService.getReward(contractId6,uid6);
rewardCount = rewardRes.jsonPath().getInt("data");
Assert.assertEquals(rewardCount, 825, "uid6领取奖励数不正确");
......@@ -373,6 +391,12 @@ public class ContractSign_Multi_signTest extends DuibaTestBase {
String desc = rewardRes.jsonPath().getString("desc");
Assert.assertEquals(success, "false", "uid1领取结果不正确");
Assert.assertEquals(desc,"领奖处理失败","uid1领取描述不正确");
rewardRes = ContractSignService.getReward(contractId6,uid6);
rewardRes.prettyPrint();
}
//@Test(description = "多梯度中奖轮播",priority = 7,dependsOnMethods = { "多梯度领奖" })
......
package http.cases.SignTest;
import base.DuibaTestBase;
import http.service.Activity.SignTreasureService;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.sql.SQLException;
import java.util.Map;
/**
* Created by mabo on 2019/10/23
*/
public class 夺宝签到_signTest extends DuibaTestBase {
@Autowired
SignTreasureService signTreasureService;
private String phaseId = "1";
private String id = "187";
private int uid= 7003;//7003 6926
@BeforeMethod
public void before(){
try {
jdbc.update("delete from sign_record.tb_sign_treasure_user_record where consumer_id=100144145");
jdbc.update("delete from sign_record.tb_sign_treasure_code_detail where consumer_id=100144145");
jdbc.update("delete from sign_record.tb_sign_log where consumer_id=100144145");
jdbc.update("delete from sign_record.tb_sign_statics where consumer_id=100144145");
} catch (SQLException e) {
e.printStackTrace();
}
}
@Test
public void 签到() throws Exception {
//获取签到信息
Response response = signTreasureService.getHomeInfo(id,uid);
//校验今日未签到
Assert.assertTrue(response.jsonPath().getString("data.todaySigned").equals("false"));
//签到
response = signTreasureService.doSign(phaseId,id,uid);
//获取logId
String logId = response.jsonPath().getString("data.logId");
//获取签到结果
Thread.sleep(3000);
response = signTreasureService.getSignResult(logId,uid);
//校验夺宝码
Assert.assertTrue(response.jsonPath().getString("data.codes").equals("[102_114_14_84]"));
//校验已签到
response = signTreasureService.getHomeInfo(id,uid);
Assert.assertTrue(response.jsonPath().getString("data.todaySigned").equals("true"));
}
@Test
public void 兑换夺宝码() throws Exception {
Map<String,Object> mapuser = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid);
String dafuwengCredits = String.valueOf(mapuser.get("credits"));
//兑换的个数
String codeCount="1";
Response response = signTreasureService.exchange(phaseId,"1",id,uid);
String orderNum = response.jsonPath().getString("data");
Thread.sleep(5000);
response = signTreasureService.orderStatus(phaseId,orderNum,uid);
response.prettyPrint();
System.out.println(response.jsonPath().getString("data.codes"));
//校验夺宝码
Assert.assertTrue(response.jsonPath().getString("data.codes").equals("[102_114_14_84]"));
mapuser = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid);
String dafuwengCreditsNew = String.valueOf(mapuser.get("credits"));
Assert.assertTrue(String.valueOf(Integer.valueOf(dafuwengCredits)-1).equals(dafuwengCreditsNew));
}
}
package http.cases.SignTest;
import base.DuibaBase;
import base.DuibaTestBase;
import http.service.Activity.SignTreasureService;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.sql.SQLException;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* Created by mabo on 2019/10/24
*/
public class 夺宝签到开奖_signTest extends DuibaTestBase {
@Autowired
SignTreasureService signTreasureService;
private String phaseId = "1";
private String id = "188";
private int uid= 6926;
private List<String> resultList = new CopyOnWriteArrayList<>();
@BeforeClass
public void before(){
try {
jdbc.update("delete from sign_record.tb_sign_win_record where consumer_id=100144031");
jdbc.update("update sign_record.tb_sign_treasure_code_detail set reward_status=1 where consumer_id=100144031");
} catch (SQLException e) {
e.printStackTrace();
}
}
//同一用户并发开奖
@Test(threadPoolSize=5, invocationCount=5)
public void 开奖() throws Exception {
Response response = signTreasureService.getReward("41",id,uid);
resultList.add(response.asString());
}
@Test(dependsOnMethods = "开奖")
public void checkResult(){
int fail=0;
int success = 0;
for (String s:
resultList) {
if(s.contains("操作太过频繁,请稍后再试")){
fail++;
}else if(s.contains("\"prizeDetailUrl\":\"/activity/takePrizeNew?recordId=")){
success++;
}else{
System.out.println(s);
}
}
//检验 成功的只有一个
Assert.assertEquals(fail,4);
Assert.assertEquals(success,1);
}
}
......@@ -85,7 +85,7 @@ public class 商品分组组件_DuibaTest extends DuibaTestBase {
case 1:
Assert.assertEquals(response.jsonPath().getString("data.rows[0].title"),"支付宝充值","校验第一个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.rows[0].customCredits"),"100000","校验第一个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.rows[0].customCredits"),"1000","校验第一个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.rows[0].smallImage"),"//yun.dui88.com/images/201610/txqn3qz6o9.jpg","校验第一个商品smallImage失败");
Assert.assertEquals(response.jsonPath().getString("data.rows[1].title"),"10元话费","校验第二个商品title失败");
......
......@@ -61,7 +61,7 @@ public class 商品组件_DuibaTest extends DuibaTestBase{
Assert.assertEquals(response.jsonPath().getString("data.rows[0].smallImage"),"//yun.duiba.com.cn/developer/img/phonebilldingzhi10/telephone_charge_breviary.jpg","校验第一个商品smallImage失败");
Assert.assertEquals(response.jsonPath().getString("data.rows[1].title"),"支付宝充值","校验第二个商品title失败");
Assert.assertEquals(response.jsonPath().getString("data.rows[1].customCredits"),"100000","校验第二个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.rows[1].customCredits"),"1000","校验第二个商品credits失败");
Assert.assertEquals(response.jsonPath().getString("data.rows[1].facePrice"),"0.00","校验第二个商品facePrice失败");
Assert.assertEquals(response.jsonPath().getString("data.rows[1].smallImage"),"//yun.dui88.com/images/201610/txqn3qz6o9.jpg","校验第二个商品smallImage失败");
......
......@@ -207,13 +207,13 @@ public class ContractSignService {
map.put("contractId", ContractId);
logger.info("请求getReward接口,契约id=" + ContractId);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(activityHost+"/sign/contract/getReward");
try{
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/contract/getReward接口请求失败");
} catch (Exception e) {
throw new Exception("/sign/contract/getReward接口失败,返回信息" + response.asString());
} catch (Error er) {
throw new Exception("/sign/contract/getReward接口失败,返回信息:" + response.asString());
}
// try{
// Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/contract/getReward接口请求失败");
// } catch (Exception e) {
// throw new Exception("/sign/contract/getReward接口失败,返回信息" + response.asString());
// } catch (Error er) {
// throw new Exception("/sign/contract/getReward接口失败,返回信息:" + response.asString());
// }
return response;
}
......
package http.service.Activity;
import base.DuibaLog;
import base.DuibaTestBase;
import http.service.Authorization;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.testng.Assert;
import java.util.HashMap;
import java.util.Map;
import static io.restassured.RestAssured.given;
/**
* Created by mabo on 2019/10/23
* 夺宝签到
*/
@Service
public class SignTreasureService {
@Value("${activity.host}")
String activityHost;
@Value("${hdserver.host}")
String hdHost;
@Autowired
Authorization authorization;
private DuibaLog logger = DuibaLog.getLogger();
public Response doSign(String phaseId,String id, int uid) throws Exception{
Map<String,String> map = new HashMap<>();
map.put("phaseId", phaseId);
map.put("id", id);
logger.info("请求sign接口,签到活动id="+id);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(activityHost+"/sign/treasure/sign");
try {
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/treasure/sign接口失败");
} catch (Exception e) {
throw new Exception("/sign/treasure/sign接口失败,返回信息:" + response.asString());
} catch (Error er) {
throw new Exception("/sign/treasure/sign接口失败,返回信息:" + response.asString());
}
return response;
}
public Response getHomeInfo(String id, int uid) throws Exception{
Map<String, String> map = new HashMap<>();
map.put("id", id);
logger.info("请求HomeInfo接口,签到活动id=" + id);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(activityHost+"/sign/treasure/homeInfo");
try{
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/treasure/homeInfo接口请求失败");
} catch (Exception e) {
throw new Exception("/sign/treasure/homeInfo接口失败,返回信息" + response.asString());
} catch (Error er) {
throw new Exception("/sign/treasure/homeInfo接口失败,返回信息:" + response.asString());
}
return response;
}
public Response getSignResult(String logId,int uid) throws Exception{
Map<String, String> map = new HashMap<>();
map.put("logId", logId);
logger.info("请求getSignResult接口,logId=" + logId);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(activityHost+"/sign/treasure/getSignResult");
try{
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/treasure/getSignResult接口请求失败");
} catch (Exception e) {
throw new Exception("/sign/treasure/getSignResult接口失败,返回信息" + response.asString());
} catch (Error er) {
throw new Exception("/sign/treasure/getSignResult接口失败,返回信息:" + response.asString());
}
return response;
}
public Response exchange(String phaseId, String codeCount, String id,int uid) throws Exception{
Map<String, String> map = new HashMap<>();
map.put("phaseId", phaseId);
map.put("codeCount", codeCount);
map.put("id", id);
logger.info("请求exchange接口,签到活动id=" + id);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(activityHost+"/sign/treasure/exchange");
try{
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/treasure/exchange接口请求失败");
} catch (Exception e) {
throw new Exception("/sign/treasure/exchange接口失败,返回信息" + response.asString());
} catch (Error er) {
throw new Exception("/sign/treasure/exchange接口失败,返回信息:" + response.asString());
}
return response;
}
public Response orderStatus(String phaseId,String orderNum, int uid) throws Exception{
Map<String, String> map = new HashMap<>();
map.put("phaseId", phaseId);
map.put("orderNum", orderNum);
logger.info("请求orderStatus接口,签到活动orderNum=" + orderNum);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(activityHost+"/sign/treasure/orderStatus");
try{
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/treasure/orderStatus接口请求失败");
} catch (Exception e) {
throw new Exception("/sign/treasure/orderStatus接口失败,返回信息" + response.asString());
} catch (Error er) {
throw new Exception("/sign/treasure/orderStatus接口失败,返回信息:" + response.asString());
}
return response;
}
public Response getReward(String detailId,String id, int uid) throws Exception{
Map<String, String> map = new HashMap<>();
map.put("detailId", detailId);
map.put("id", id);
logger.info("请求getReward接口,id=" + detailId);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).post(activityHost+"/sign/treasure/getReward");
// try{
// Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/treasure/getReward接口请求失败");
// } catch (Exception e) {
// throw new Exception("/sign/treasure/getReward接口失败,返回信息" + response.asString());
// } catch (Error er) {
// throw new Exception("/sign/treasure/getReward接口失败,返回信息:" + response.asString());
// }
return response;
}
public Response waitWinRecord(String id, int uid) throws Exception{
Map<String, String> map = new HashMap<>();
map.put("id", id);
logger.info("请求waitWinRecord接口,id=" + id);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(activityHost+"/sign/treasure/waitWinRecord");
try{
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/sign/treasure/waitWinRecord接口请求失败");
} catch (Exception e) {
throw new Exception("/sign/treasure/waitWinRecord接口失败,返回信息" + response.asString());
} catch (Error er) {
throw new Exception("/sign/treasure/waitWinRecord接口失败,返回信息:" + response.asString());
}
return response;
}
}
This diff is collapsed.
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