Commit 3a8efc6c authored by 吕雯燕's avatar 吕雯燕

lv

parent 93ddf7eb
......@@ -187,6 +187,48 @@ public class 集卡活动领奖_AccessTest extends DuibaTestBase {
logger.info("校验成功:集卡活动已下架领奖失败");
}
@Test(description = "集卡活动已结束,领奖测试")
public void 集卡活动已结束再领奖() throws Exception{
int uid = 7450;
String activityId = "45619";
Response response = clcardService.openPrize2(uid,activityId);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("desc"),"活动已结束","校验desc失败");
logger.info("校验成功:集卡活动已结束领奖失败");
}
@Test(description = "开发者余额不足,集卡领奖支付宝测试")
public void 开发者余额不足领奖() throws Exception{
//开发者账号:13000000000
int uid = 7452;
String activityId = "45622";
Response response = clcardService.openPrize(uid,activityId);
String orderNum = response.jsonPath().getString("data.orderNum");
response = clcardService.getOrderStatus(uid,orderNum);
response.prettyPrint();
String result = String.valueOf(response.jsonPath().getString("result"));
int i= 30;
while(i>0&&(result.equals("0"))){
Thread.sleep(500);
response = clcardService.getOrderStatus(uid,orderNum);
result = String.valueOf(response.jsonPath().getString("result"));
i--;
response.prettyPrint();
}
//库存不足,接口会轮询处理超时
Assert.assertEquals(result,"0","校验result失败");
Assert.assertEquals(response.jsonPath().getString("takeSuccess"),"false","校验takeSuccess失败");
logger.info("校验成功:开发者余额不足领奖支付宝失败");
}
......
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