Commit 9c826a5d authored by xiamengchen's avatar xiamengchen

覆盖秒杀互动

parent df1e26e3
package com.kjj.bean.secondKill;
import lombok.Data;
@Data
public class AnchorGetKGList {
private String goodsTitle;
private String id;
}
......@@ -5,5 +5,5 @@ import lombok.Data;
@Data
public class AnchorGetSKList {
private int interactStatus;
private long id;
private String id;
}
......@@ -2324,6 +2324,25 @@ public class SaveLive implements Authorization {
Assert.assertNotNull(data, network.message(Params, BasicConfig.MANAGER_otherDetail, "查询第6轮时长红包详情失败", response.body().asString()));
}
/**
* 亲友抽奖券配置
*/
@Test(description = "保存亲友抽奖券配置", priority = 128)
public void 保存亲友抽奖券配置(){
ssoLogin();
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("giftedImg","https://yun.dui88.com/kjy/image/20210825/1629861430316.png");
Params.put("notGiftedImg","https://yun.dui88.com/kjy/image/20210825/1629861425857.png");
Params.put("popImg","https://yun.dui88.com/kjy/image/20210825/1629861435394.png");
Params.put("envelopeWord","这是信封话术");
Params.put("lotteryName","亲友抽奖券");
Params.put("lotteryNum",3);
Params.put("lotteryDesc","这是亲友抽奖券的说明");
Response response = network.postResponse(Params, BasicConfig.MANAGER_relativeLottery);
System.out.println(response.body().asString());
boolean data =response.jsonPath().getBoolean("data");
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_relativeLottery, "保存亲友券配置失败", response.body().asString()));
}
@Test(description = "查看亲友抽奖券配置详情", priority = 129)
......
package com.kjj.cases.live.secondKill;
import com.kjj.bean.secondKill.AnchorGetKGList;
import com.kjj.bean.secondKill.AnchorGetSKList;
import com.kjj.bean.secondKill.KillGoodsList;
import com.kjj.bean.secondKill.SecondKillList;
import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig;
......@@ -22,9 +22,10 @@ public class ConfSecondKill implements Authorization {
private final long companyId = 101;
private long newSecKillId; // 会被删除的秒杀id
private static final long secKillGoodsId = 111; // 用来配置轮次的秒杀商品ID
private static final long secKillGoodsId = 115; // 用来配置轮次的秒杀商品ID
public static final String secKillGoodsIdEncode = IdMakeUtil.managerEncodingId(secKillGoodsId);
private long skId; // 秒杀id
private String skId; // 秒杀id
public static int killListSize;
@BeforeClass
public void setUp(){
......@@ -99,7 +100,7 @@ public class ConfSecondKill implements Authorization {
int goodsAmount = secondKillList.getGoodsAmount();
Assert.assertEquals(goodsAmount, 1, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品价格与实际添加的不符", liveSecKillRes.body().asString()));
String goodsTitle = secondKillList.getGoodsTitle();
Assert.assertEquals(goodsTitle, "秒杀商品4", network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品名称与实际添加的不符", liveSecKillRes.body().asString()));
Assert.assertEquals(goodsTitle, "自动化专用商品", network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品名称与实际添加的不符", liveSecKillRes.body().asString()));
int interactNum = secondKillList.getInteractNum();
Assert.assertEquals(interactNum, 3, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品数量与实际添加的不符", liveSecKillRes.body().asString()));
int surplusNum = secondKillList.getSurplusNum();
......@@ -164,10 +165,10 @@ public class ConfSecondKill implements Authorization {
Map<String, Object> skGoodsListPar = new HashMap<>();
skGoodsListPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response skGoodsListRes = network.getResponse(skGoodsListPar, BasicConfig.ANCHOR_skGoodsLists);
List<KillGoodsList> killGoodsLists;
List<AnchorGetKGList> anchorGetKGLists;
try {
killGoodsLists = JsonUtil.parseResponseToListBean(skGoodsListRes, KillGoodsList.class);
String goodTitle = killGoodsLists.get(0).getGoodsTitle();
anchorGetKGLists = JsonUtil.parseResponseToListBean(skGoodsListRes, AnchorGetKGList.class);
String goodTitle = anchorGetKGLists.get(0).getGoodsTitle();
Assert.assertEquals(goodTitle, "自动化专用商品", network.message(skGoodsListPar, BasicConfig.ANCHOR_skGoodsLists, "商品名称不正确", skGoodsListRes.body().asString()));
}catch (Exception e){
e.printStackTrace();
......@@ -201,8 +202,8 @@ public class ConfSecondKill implements Authorization {
List<AnchorGetSKList> secKillLists;
try {
secKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, AnchorGetSKList.class);
skId = secKillLists.get(-1).getId();
System.out.println(secKillLists);
killListSize = secKillLists.size();
skId = secKillLists.get(killListSize - 1).getId();
System.out.println(skId);
}catch (Exception e){
e.printStackTrace();
......@@ -217,7 +218,7 @@ public class ConfSecondKill implements Authorization {
secKillUpdatePar.put("goodsId", secKillGoodsIdEncode);
secKillUpdatePar.put("goodsAmount", 1);
secKillUpdatePar.put("interactNum", 3);
secKillUpdatePar.put("id", IdMakeUtil.managerEncodingId(skId));
secKillUpdatePar.put("id", skId);
secKillUpdatePar.put("ableAgent", 0);
Response secKillUpdateRes = network.postResponse(secKillUpdatePar, BasicConfig.ANCHOR_secondKillUpdate);
try {
......
......@@ -143,6 +143,12 @@ public class BasicConfig {
public static final String ANCHOR_secondKillLists = MOBILE_HOST + "/conf/live/second/kill/goods/list";
public static final String ANCHOR_secondKillUpdate = MOBILE_HOST + "/conf/live/second/kill/goods/update";
public static final String ANCHOR_skGoodsLists = MOBILE_HOST + "/conf/live/second/kill/goods/goodsList";
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 ANCHOR_secondKillOn = MOBILE_HOST + "/conf/live/second/kill/goods/on";
public static final String MOBILE_secondKill_goodsFirst = MOBILE_HOST + "/clue/goods/first";
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 MANAGER_saveDialogue = MANAGER_HOST + "/kjy/manager/live/potential/saveDialogue";
......
......@@ -72,11 +72,11 @@
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="亲友券">
<classes>
<class name="com.kjj.cases.live.lottery.RelativeLottery"/>
</classes>
</test>
<!-- <test preserve-order="true" name="亲友券">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.lottery.RelativeLottery"/>-->
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="false" name="翻牌集字红包">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.flipCard.FlipCard"/>-->
......@@ -122,11 +122,11 @@
<!-- </classes>-->
<!-- </test>-->
<!-- <test preserve-order="true" name="直播中抽奖">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.lottery.Lottery"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="直播中抽奖">
<classes>
<class name="com.kjj.cases.live.lottery.Lottery"/>
</classes>
</test>
<test preserve-order="true" name="秒杀互动">
<classes>
<class name="com.kjj.cases.live.secondKill.SecondKill"/>
......
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