Commit 6c519b7b authored by xiamengchen's avatar xiamengchen

秒杀互动支付成功前流程

parent f8da03ea
...@@ -7,4 +7,5 @@ public class AnchorGetSKList { ...@@ -7,4 +7,5 @@ public class AnchorGetSKList {
private int interactStatus; private int interactStatus;
private String id; private String id;
private int surplusNum; private int surplusNum;
private String goodsId;
} }
...@@ -229,16 +229,6 @@ public class Answer implements Authorization { ...@@ -229,16 +229,6 @@ public class Answer implements Authorization {
//访客端 //访客端
/*查询访客端有奖答题配置详情*/ /*查询访客端有奖答题配置详情*/
@Test(description = "代理人关系绑定", priority = 11)
public void 代理人关系绑定() {
agentAuth();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
@Test(description = "访客A查询答题红包配置", priority = 12) @Test(description = "访客A查询答题红包配置", priority = 12)
public void 访客A查询答题红包配置() public void 访客A查询答题红包配置()
{ {
......
...@@ -24,7 +24,8 @@ public class ConfSecondKill implements Authorization { ...@@ -24,7 +24,8 @@ public class ConfSecondKill implements Authorization {
private long newSecKillId; // 会被删除的秒杀id private long newSecKillId; // 会被删除的秒杀id
private static final long secKillGoodsId = 115; // 用来配置轮次的秒杀商品ID private static final long secKillGoodsId = 115; // 用来配置轮次的秒杀商品ID
public static final String secKillGoodsIdEncode = IdMakeUtil.managerEncodingId(secKillGoodsId); public static final String secKillGoodsIdEncode = IdMakeUtil.managerEncodingId(secKillGoodsId);
private String skId; // 秒杀id public static String skIdFirst; // 第一轮秒杀id
public static String skIdSecond; // 第二轮秒杀ID
public static int killListSize; public static int killListSize;
@BeforeClass @BeforeClass
...@@ -194,7 +195,25 @@ public class ConfSecondKill implements Authorization { ...@@ -194,7 +195,25 @@ public class ConfSecondKill implements Authorization {
} }
} }
@Test(description = "助播端获取秒杀轮次列表", priority = 8) @Test(description = "新增第二轮秒杀", priority = 8)
public void 新增第二轮秒杀() {
Map<String, Object> secKillAddPar = new HashMap<>();
secKillAddPar.put("goodsId", secKillGoodsIdEncode);
secKillAddPar.put("goodsAmount", 1); // 1 == 0.01
secKillAddPar.put("interactNum", 1);
secKillAddPar.put("ableAgent", 1); // 代理人可参与
secKillAddPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response secKillAddRes = network.postResponse(secKillAddPar, BasicConfig.ANCHOR_secondKillSave);
try {
boolean data = secKillAddRes.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(secKillAddPar, BasicConfig.ANCHOR_secondKillSave, "新增轮次失败", secKillAddRes.body().asString()));
}catch (NullPointerException e){
e.printStackTrace();
Assert.fail(network.message(secKillAddPar, BasicConfig.ANCHOR_secondKillSave, "未获取到数据", secKillAddRes.body().asString()));
}
}
@Test(description = "助播端获取秒杀轮次列表", priority = 9)
public void 助播端获取秒杀轮次列表() { public void 助播端获取秒杀轮次列表() {
Map<String, Object> liveSecKillPar = new HashMap<>(); Map<String, Object> liveSecKillPar = new HashMap<>();
liveSecKillPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); liveSecKillPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
...@@ -203,8 +222,10 @@ public class ConfSecondKill implements Authorization { ...@@ -203,8 +222,10 @@ public class ConfSecondKill implements Authorization {
try { try {
secKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, AnchorGetSKList.class); secKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, AnchorGetSKList.class);
killListSize = secKillLists.size(); killListSize = secKillLists.size();
skId = secKillLists.get(killListSize - 1).getId(); String goodsId = secKillLists.get(0).getGoodsId();
System.out.println(skId); Assert.assertEquals(goodsId, secKillGoodsIdEncode, network.message(liveSecKillPar, BasicConfig.ANCHOR_secondKillLists, "轮次对应商品ID错误", liveSecKillRes.body().asString()));
skIdFirst = secKillLists.get(0).getId();
skIdSecond = secKillLists.get(1).getId();
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
Assert.fail(network.message(liveSecKillPar, BasicConfig.ANCHOR_secondKillLists, "未获取到数据", liveSecKillRes.body().asString())); Assert.fail(network.message(liveSecKillPar, BasicConfig.ANCHOR_secondKillLists, "未获取到数据", liveSecKillRes.body().asString()));
...@@ -212,13 +233,13 @@ public class ConfSecondKill implements Authorization { ...@@ -212,13 +233,13 @@ public class ConfSecondKill implements Authorization {
} }
@Test(description = "助播端编辑秒杀轮次", priority = 9) @Test(description = "助播端编辑秒杀轮次", priority = 10)
public void 助播端编辑秒杀轮次() { public void 助播端编辑秒杀轮次() {
Map<String, Object> secKillUpdatePar = new HashMap<>(); Map<String, Object> secKillUpdatePar = new HashMap<>();
secKillUpdatePar.put("goodsId", secKillGoodsIdEncode); secKillUpdatePar.put("goodsId", secKillGoodsIdEncode);
secKillUpdatePar.put("goodsAmount", 1); secKillUpdatePar.put("goodsAmount", 1);
secKillUpdatePar.put("interactNum", 3); secKillUpdatePar.put("interactNum", 3);
secKillUpdatePar.put("id", skId); secKillUpdatePar.put("id", skIdFirst);
secKillUpdatePar.put("ableAgent", 0); secKillUpdatePar.put("ableAgent", 0);
Response secKillUpdateRes = network.postResponse(secKillUpdatePar, BasicConfig.ANCHOR_secondKillUpdate); Response secKillUpdateRes = network.postResponse(secKillUpdatePar, BasicConfig.ANCHOR_secondKillUpdate);
try { try {
......
...@@ -1055,6 +1055,19 @@ public class Treasure implements Authorization { ...@@ -1055,6 +1055,19 @@ public class Treasure implements Authorization {
} }
/**
* 添加代理人绑定关系
*/
@Test(description = "代理人绑定", priority = 70)
public void 代理人绑定() {
agentAuth();
Map<String, Object> bindingParam = new HashMap<>();
bindingParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response bindingRes = network.postResponse(bindingParam, BasicConfig.MOBILE_binding);
boolean success = bindingRes.jsonPath().getJsonObject("success");
System.out.println(success);
Assert.assertTrue(success, network.message(bindingParam, BasicConfig.MOBILE_binding, "绑定失败", bindingRes.body().asString()));
}
......
...@@ -146,7 +146,9 @@ public class BasicConfig { ...@@ -146,7 +146,9 @@ public class BasicConfig {
public static final String MOBILE_secondKill_getGoodsList = MOBILE_HOST + "/clue/goods/list"; public static final String MOBILE_secondKill_getGoodsList = MOBILE_HOST + "/clue/goods/list";
public static final String MOBILE_secondKill_getGoodsDetail = MOBILE_HOST + "/clue/goods/detail"; public static final String MOBILE_secondKill_getGoodsDetail = MOBILE_HOST + "/clue/goods/detail";
public static final String ANCHOR_secondKillOn = MOBILE_HOST + "/conf/live/second/kill/goods/on"; public static final String ANCHOR_secondKillOn = MOBILE_HOST + "/conf/live/second/kill/goods/on";
public static final String ANCHOR_secondKillOff = MOBILE_HOST + "/conf/live/second/kill/goods/off";
public static final String MOBILE_secondKill_goodsFirst = MOBILE_HOST + "/clue/goods/first"; public static final String MOBILE_secondKill_goodsFirst = MOBILE_HOST + "/clue/goods/first";
public static final String MOBILE_secondKill_downgradeGoodsFirst = MOBILE_HOST + "/clue/downgrade/goods";
public static final String MOBILE_secondKill_goodsOrder = MOBILE_HOST + "/clue/goods/order"; public static final String MOBILE_secondKill_goodsOrder = MOBILE_HOST + "/clue/goods/order";
public static final String MOBILE_secondKill_goodsOrderResult = MOBILE_HOST + "/clue/goods/order/result"; public static final String MOBILE_secondKill_goodsOrderResult = MOBILE_HOST + "/clue/goods/order/result";
public static final String MOBILE_secondKill_killGoods = MOBILE_HOST + "/clue/goods/killGoods"; public static final String MOBILE_secondKill_killGoods = MOBILE_HOST + "/clue/goods/killGoods";
......
...@@ -62,5 +62,19 @@ public class IdMakeUtil implements Authorization { ...@@ -62,5 +62,19 @@ public class IdMakeUtil implements Authorization {
return encodeId; return encodeId;
} }
public static long managerDecodeingId(String code) {
BaseUtils.ssoLogin();
Map<String, Object> decodePar = new HashMap<>();
decodePar.put("code", code);
Response decodeRes = network.getResponse(decodePar, BasicConfig.MANAGER_ID_DECODE);
long decodeId = 0;
try {
decodeId = decodeRes.jsonPath().getLong("data");
}catch (NullPointerException e){
e.printStackTrace();
}
return decodeId;
}
} }
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