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; ...@@ -5,5 +5,5 @@ import lombok.Data;
@Data @Data
public class AnchorGetSKList { public class AnchorGetSKList {
private int interactStatus; private int interactStatus;
private long id; private String id;
} }
...@@ -2324,6 +2324,25 @@ public class SaveLive implements Authorization { ...@@ -2324,6 +2324,25 @@ public class SaveLive implements Authorization {
Assert.assertNotNull(data, network.message(Params, BasicConfig.MANAGER_otherDetail, "查询第6轮时长红包详情失败", response.body().asString())); 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) @Test(description = "查看亲友抽奖券配置详情", priority = 129)
......
package com.kjj.cases.live.secondKill; package com.kjj.cases.live.secondKill;
import com.kjj.bean.secondKill.AnchorGetKGList;
import com.kjj.bean.secondKill.AnchorGetSKList; import com.kjj.bean.secondKill.AnchorGetSKList;
import com.kjj.bean.secondKill.KillGoodsList;
import com.kjj.bean.secondKill.SecondKillList; import com.kjj.bean.secondKill.SecondKillList;
import com.kjj.cases.admin.Authorization; import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig; import com.kjj.config.BasicConfig;
...@@ -22,9 +22,10 @@ public class ConfSecondKill implements Authorization { ...@@ -22,9 +22,10 @@ public class ConfSecondKill implements Authorization {
private final long companyId = 101; private final long companyId = 101;
private long newSecKillId; // 会被删除的秒杀id 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); public static final String secKillGoodsIdEncode = IdMakeUtil.managerEncodingId(secKillGoodsId);
private long skId; // 秒杀id private String skId; // 秒杀id
public static int killListSize;
@BeforeClass @BeforeClass
public void setUp(){ public void setUp(){
...@@ -99,7 +100,7 @@ public class ConfSecondKill implements Authorization { ...@@ -99,7 +100,7 @@ public class ConfSecondKill implements Authorization {
int goodsAmount = secondKillList.getGoodsAmount(); int goodsAmount = secondKillList.getGoodsAmount();
Assert.assertEquals(goodsAmount, 1, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品价格与实际添加的不符", liveSecKillRes.body().asString())); Assert.assertEquals(goodsAmount, 1, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品价格与实际添加的不符", liveSecKillRes.body().asString()));
String goodsTitle = secondKillList.getGoodsTitle(); 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(); int interactNum = secondKillList.getInteractNum();
Assert.assertEquals(interactNum, 3, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品数量与实际添加的不符", liveSecKillRes.body().asString())); Assert.assertEquals(interactNum, 3, network.message(liveSecKillPar, BasicConfig.MANAGER_secondKillLists, "商品数量与实际添加的不符", liveSecKillRes.body().asString()));
int surplusNum = secondKillList.getSurplusNum(); int surplusNum = secondKillList.getSurplusNum();
...@@ -164,10 +165,10 @@ public class ConfSecondKill implements Authorization { ...@@ -164,10 +165,10 @@ public class ConfSecondKill implements Authorization {
Map<String, Object> skGoodsListPar = new HashMap<>(); Map<String, Object> skGoodsListPar = new HashMap<>();
skGoodsListPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); skGoodsListPar.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response skGoodsListRes = network.getResponse(skGoodsListPar, BasicConfig.ANCHOR_skGoodsLists); Response skGoodsListRes = network.getResponse(skGoodsListPar, BasicConfig.ANCHOR_skGoodsLists);
List<KillGoodsList> killGoodsLists; List<AnchorGetKGList> anchorGetKGLists;
try { try {
killGoodsLists = JsonUtil.parseResponseToListBean(skGoodsListRes, KillGoodsList.class); anchorGetKGLists = JsonUtil.parseResponseToListBean(skGoodsListRes, AnchorGetKGList.class);
String goodTitle = killGoodsLists.get(0).getGoodsTitle(); String goodTitle = anchorGetKGLists.get(0).getGoodsTitle();
Assert.assertEquals(goodTitle, "自动化专用商品", network.message(skGoodsListPar, BasicConfig.ANCHOR_skGoodsLists, "商品名称不正确", skGoodsListRes.body().asString())); Assert.assertEquals(goodTitle, "自动化专用商品", network.message(skGoodsListPar, BasicConfig.ANCHOR_skGoodsLists, "商品名称不正确", skGoodsListRes.body().asString()));
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
...@@ -201,8 +202,8 @@ public class ConfSecondKill implements Authorization { ...@@ -201,8 +202,8 @@ public class ConfSecondKill implements Authorization {
List<AnchorGetSKList> secKillLists; List<AnchorGetSKList> secKillLists;
try { try {
secKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, AnchorGetSKList.class); secKillLists = JsonUtil.parseResponseToListBean(liveSecKillRes, AnchorGetSKList.class);
skId = secKillLists.get(-1).getId(); killListSize = secKillLists.size();
System.out.println(secKillLists); skId = secKillLists.get(killListSize - 1).getId();
System.out.println(skId); System.out.println(skId);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
...@@ -217,7 +218,7 @@ public class ConfSecondKill implements Authorization { ...@@ -217,7 +218,7 @@ public class ConfSecondKill implements Authorization {
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", IdMakeUtil.managerEncodingId(skId)); secKillUpdatePar.put("id", skId);
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 {
......
...@@ -143,6 +143,12 @@ public class BasicConfig { ...@@ -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_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_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 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"; public static final String MANAGER_saveDialogue = MANAGER_HOST + "/kjy/manager/live/potential/saveDialogue";
......
...@@ -72,11 +72,11 @@ ...@@ -72,11 +72,11 @@
<!-- </classes>--> <!-- </classes>-->
<!-- </test>--> <!-- </test>-->
<test preserve-order="true" name="亲友券"> <!-- <test preserve-order="true" name="亲友券">-->
<classes> <!-- <classes>-->
<class name="com.kjj.cases.live.lottery.RelativeLottery"/> <!-- <class name="com.kjj.cases.live.lottery.RelativeLottery"/>-->
</classes> <!-- </classes>-->
</test> <!-- </test>-->
<!-- <test preserve-order="false" name="翻牌集字红包">--> <!-- <test preserve-order="false" name="翻牌集字红包">-->
<!-- <classes>--> <!-- <classes>-->
<!-- <class name="com.kjj.cases.live.flipCard.FlipCard"/>--> <!-- <class name="com.kjj.cases.live.flipCard.FlipCard"/>-->
...@@ -122,11 +122,11 @@ ...@@ -122,11 +122,11 @@
<!-- </classes>--> <!-- </classes>-->
<!-- </test>--> <!-- </test>-->
<!-- <test preserve-order="true" name="直播中抽奖">--> <test preserve-order="true" name="直播中抽奖">
<!-- <classes>--> <classes>
<!-- <class name="com.kjj.cases.live.lottery.Lottery"/>--> <class name="com.kjj.cases.live.lottery.Lottery"/>
<!-- </classes>--> </classes>
<!-- </test>--> </test>
<test preserve-order="true" name="秒杀互动"> <test preserve-order="true" name="秒杀互动">
<classes> <classes>
<class name="com.kjj.cases.live.secondKill.SecondKill"/> <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