Commit ba0fe03a authored by 赵然's avatar 赵然

zr

parent f1e60999
......@@ -31,7 +31,7 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
private static int uid = 4689;
private static int uid2 = 4552;
private static int uid3 = 3590;
private static int uid4 = 4386;
@Test
public void 出券衰减开关校验_() throws Exception {
//dafuweng登陆获取cookies
......@@ -59,6 +59,7 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
logger.info("种红包的红包配置接口校验正确");
}
......@@ -102,4 +103,33 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
logger.info("种红包的红包配置接口校验正确");
}
@Test
public void 衰减红包校验() throws Exception {
//dafuweng登陆获取cookies
Map cookies = authorization.dafuwengLogin(uid4);
//调用种植seed
Response response = seedRedPacketService.seed(cookies,"1","424","1");
//种子号
String orderId = response.jsonPath().getString("data.orderNum");
Assert.assertNotNull(orderId,"订单号为空");
logger.info("红包订单为:"+orderId);
//红包衰减
Thread.sleep(65000);
//获取种植结果状态getOrderStatus,异步接口,while循环,status为2处理完成,1处理中
response = seedRedPacketService.getOrderStatus(cookies,orderId);
String status = response.jsonPath().getString("data");
int i =5;
while(i>0&&status.equals("1")){
response = seedRedPacketService.getOrderStatus(cookies,orderId);
status = response.jsonPath().getString("data");
i--;
}
//获取种植获得金额
response = seedRedPacketService.reap(cookies,"1",orderId);
response.prettyPrint();
String isDecr = response.jsonPath().getString("data.isDecr");
Assert.assertEquals(isDecr,"true","红包衰减标识校验失败");
}
}
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