Commit 02d10636 authored by 张艳玲's avatar 张艳玲

Merge branch '20210412bxl' into 'master'

红包

See merge request test-group/kejiji!48
parents 5dd54125 6691008b
package com.kjj.bean;
import lombok.Data;
@Data
public class RedFindDetail {
private String confId;
private String totalAmount;
private String totalNum;
private String luckAmount;
private String luckNum;
private String luckHelpNum;
private String generalNum;
private String showAmount;
private String afterMin;
}
...@@ -5,12 +5,12 @@ import lombok.Data; ...@@ -5,12 +5,12 @@ import lombok.Data;
@Data @Data
public class RedHelpQuery { public class RedHelpQuery {
private String avatar; private String avatar;
private String end; private boolean end;
private String hasConfLuck; private boolean hasConfLuck;
private String help; private boolean help;
private String helpShareUser; private boolean helpShareUser;
private String nickname; private String nickname;
private String selfShare; private boolean selfShare;
} }
......
...@@ -2,8 +2,10 @@ package com.kjj.bean; ...@@ -2,8 +2,10 @@ package com.kjj.bean;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class RedHepDetail { public class RedHepDetail {
private String helpAvatarList; private List helpAvatarList;
private int myHelpNum; private int myHelpNum;
} }
...@@ -16,11 +16,10 @@ public class RedLuckResult { ...@@ -16,11 +16,10 @@ public class RedLuckResult {
{ {
private String avatar; private String avatar;
private String nickname; private String nickname;
private String receivedAmount; private int receivedAmount;
} }
private String hasNext; private boolean hasNext;
......
...@@ -5,10 +5,10 @@ import lombok.Data; ...@@ -5,10 +5,10 @@ import lombok.Data;
@Data @Data
public class RedNum { public class RedNum {
private String totalAmount; private int totalAmount;
private String luckAmount; private int luckAmount;
private String luckNum; private int luckNum;
} }
...@@ -6,6 +6,6 @@ import lombok.Data; ...@@ -6,6 +6,6 @@ import lombok.Data;
public class RedOpendate { public class RedOpendate {
private int state; private int state;
private String amount; private String amount;
private String luck; private boolean luck;
private String code; private String code;
} }
package com.kjj.bean;
import lombok.Data;
import java.util.List;
@Data
public class RedSultList {
private List<resulList> list;
@Data
public static class resulList
{
private String avatar;
private String nickname;
private int receivedAmount;
private boolean receivedLuck;
}
private boolean hasNext;
}
...@@ -17,6 +17,7 @@ import java.util.Map; ...@@ -17,6 +17,7 @@ import java.util.Map;
public class LiveVistorRed implements AdminAuthorization{ public class LiveVistorRed implements AdminAuthorization{
public String confId_Red; public String confId_Red;
public String visitor_red;
public String red_sharesign; public String red_sharesign;
private AnchorRedList.RedList getRed(List<AnchorRedList.RedList> lists){ private AnchorRedList.RedList getRed(List<AnchorRedList.RedList> lists){
for (AnchorRedList.RedList red : lists) { for (AnchorRedList.RedList red : lists) {
...@@ -27,10 +28,11 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -27,10 +28,11 @@ public class LiveVistorRed implements AdminAuthorization{
return null; return null;
} }
/*主播端添加红包*/ /*主播端添加手气王红包*/
@Test(description = "主播端添加红包", priority = 1) @Test(description = "主播端添加手气王红包", priority =1)
public void 主播端添加红包() public void 主播端添加红包()
{ {
ThreadSleepUtils.sleep(10000);
adminAuth(); adminAuth();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("luck","0"); params.put("luck","0");
...@@ -46,11 +48,33 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -46,11 +48,33 @@ public class LiveVistorRed implements AdminAuthorization{
Response response = network.postResponse(params, BasicConfig.MOBILE_RedSaveOrUpdate); Response response = network.postResponse(params, BasicConfig.MOBILE_RedSaveOrUpdate);
Object data = response.jsonPath().getJsonObject("data"); Object data = response.jsonPath().getJsonObject("data");
System.out.println(JSON.toJSONString(data)); System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedSaveOrUpdate, "主播端添加红包失败", response.body().asString())); Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedSaveOrUpdate, "主播端添加手气王红包失败", response.body().asString()));
}
/*主播端添加普通红包*/
@Test(description = "主播端添加普通红包", priority = 2)
public void 主播端添加普通红包()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("luck","0");
params.put("luckAmount","0");
params.put("luckNum","0");
params.put("luckHelpNum","0");
params.put("general","0");
params.put("totalAmount","100");
params.put("showAmount","100");
params.put("generalNum","3");
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId","");
Response response = network.postResponse(params, BasicConfig.MOBILE_RedSaveOrUpdate);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedSaveOrUpdate, "主播端添加普通红包失败", response.body().asString()));
} }
/*主播端红包轮次查询*/ /*主播端红包轮次查询*/
@Test(description = "主播端红包轮次查询", priority = 2) @Test(description = "主播端红包轮次查询", priority = 3)
public void 主播端红包轮次查询() public void 主播端红包轮次查询()
{ {
adminAuth(); adminAuth();
...@@ -64,14 +88,211 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -64,14 +88,211 @@ public class LiveVistorRed implements AdminAuthorization{
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_AnchorRedList, "查询主播端红包轮次失败", response.body().asString())); Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_AnchorRedList, "查询主播端红包轮次失败", response.body().asString()));
} }
//主播端单个红包配置详情查询
@Test(description = "主播端单个红包配置详情查询", priority = 4)
public void 主播端单个轮次红包配置详情查询()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId",confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedFindDetail);
RedFindDetail Beans=JsonUtil.parseResponseToBean(response, RedFindDetail.class);
System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedFindDetail, "查询主播端单个红包配置详情失败", response.body().asString()));
}
/*主播端上架普通红包*/ /*主播端上架普通红包*/
@Test(description = "主播端上架普通红包", priority = 3) @Test(description = "主播端上架普通红包", priority = 5)
public void 主播端上架手气王红包() public void 主播端上架普通红包()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId",confId_Red);
Response response = network.postResponse(params, BasicConfig.MOBILE_Grounding);
boolean data = response.jsonPath().getBoolean("success");
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_Grounding, "上架普通红包失败", response.body().asString()));
}
/*主播端发放普通红包*/
@Test(description = "主播端发放普通红包", priority = 6)
public void 主播端发放普通红包()
{ {
adminAuth(); adminAuth();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId",confId_Red); params.put("confId",confId_Red);
Response response = network.postResponse(params, BasicConfig.MOBILE_RedStart);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedStart, "发放普通红包失败", response.body().asString()));
}
/*查询红包开始时间,倒计时*/
@Test(description = "查询红包开始时间", priority = 7)
public void 查询红包开始时间()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId",confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedGetSimple);
RedGetSimple Beans = JsonUtil.parseResponseToBean(response, RedGetSimple.class);
System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedGetSimple, "查询主播端发放红包开始时间失败", response.body().asString()));
}
/*查询访客端红包状态*/
@Test(description = "红包状态查询", priority = 8)
public void 红包状态查询列表()
{
ThreadSleepUtils.sleep(2000);
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_FindRedList);
List<RedOrdinary> Beans = JsonUtil.parseResponseToListBean(response, RedOrdinary.class);
RedOrdinary one = Beans.get(0);
System.out.println(one.getConfId());
visitor_red=one.getConfId();
System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_FindRedList, "查询红包状态失败", response.body().asString()));
}
/*开普通红包*/
@Test(description = "开红包", priority = 9)
public void 开红包()
{
visitorAuth();
ThreadSleepUtils.sleep(60000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red);
Response response = network.postResponse(params, BasicConfig.MOBILE_RedOpen);
boolean data = response.jsonPath().getBoolean("success");
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedOpen, "开红包失败", response.body().asString()));
}
/*代理人开普通红包*/
@Test(description = "代理人开红包", priority = 10)
public void 代理人开红包()
{
agentAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red);
Response response = network.postResponse(params, BasicConfig.MOBILE_RedOpen);
boolean data = response.jsonPath().getBoolean("success");
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedOpen, "开红包失败", response.body().asString()));
}
@Test(description = "红包个数", priority = 11)
public void 红包个数()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedNum);
RedNum Beans = JsonUtil.parseResponseToBean(response, RedNum.class);
System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedNum, "查询红包个数失败", response.body().asString()));
}
/*领普通红包轮询结果*/
@Test(description = "领普通红包轮询结果", priority = 12)
public void 领普通红包轮询结果()
{
ThreadSleepUtils.sleep(10000);
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_OpenState);
RedOpendate data=JsonUtil.parseResponseToBean(response, RedOpendate.class);
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_OpenState, "领普通红包轮询结果查询失败", response.body().asString()));
}
/*领红包结果*/
@Test(description = "领红包结果", priority = 13)
public void 领红包结果()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedState);
RedState data=JsonUtil.parseResponseToBean(response, RedState.class);
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedState, "领红包结果查询失败", response.body().asString()));
}
/*查询红包领取结果列表-看看大家手气*/
@Test(description = "查询红包领取结果列表", priority = 14)
public void 查询红包领取结果列表()
{
visitorAuth();
ThreadSleepUtils.sleep(20000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red);
params.put("pageIndex", 1);
params.put("pageSize", 10);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedResultList);
RedLuckResult Beans = JsonUtil.parseResponseToBean(response, RedLuckResult.class);
System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedResultList, "查询红包领取结果列表", response.body().asString()));
}
//************手气王红包************//
//************手气王红包************//
//************手气王红包************//
/*再次查询主播端红包轮次*/
@Test(description = "再次查询主播端红包轮次", priority = 15)
public void 再次查询主播端红包轮次()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_AnchorRedList);
AnchorRedList Beans=JsonUtil.parseResponseToBean(response, AnchorRedList.class);
AnchorRedList.RedList notPublishRed = getRed(Beans.getRedList());
confId_Red = notPublishRed.getConfId();
System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_AnchorRedList, "查询主播端红包轮次失败", response.body().asString()));
}
//主播端单个手气王红包配置详情查询
@Test(description = "主播端单个红包配置详情查询", priority = 16)
public void 主播端单个手气王红包配置详情查询()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId",confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedFindDetail);
RedFindDetail Beans=JsonUtil.parseResponseToBean(response, RedFindDetail.class);
System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedFindDetail, "查询主播端单个手气王红包配置详情失败", response.body().asString()));
}
/*主播端上架手气王红包*/
@Test(description = "主播端上架手气王红包", priority = 17)
public void 主播端上架手气王红包()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId",confId_Red);
Response response = network.postResponse(params, BasicConfig.MOBILE_Grounding); Response response = network.postResponse(params, BasicConfig.MOBILE_Grounding);
boolean data = response.jsonPath().getBoolean("success"); boolean data = response.jsonPath().getBoolean("success");
System.out.println(JSON.toJSONString(data)); System.out.println(JSON.toJSONString(data));
...@@ -79,12 +300,12 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -79,12 +300,12 @@ public class LiveVistorRed implements AdminAuthorization{
} }
/*访客端-获取直播间参数-getShareSign*/ /*访客端-获取直播间参数-getShareSign*/
@Test(description = "获取直播间参数", priority = 4) @Test(description = "获取直播间参数", priority = 18)
public void 获取直播间参数() public void 获取直播间参数()
{ {
visitorAuth(); visitorAuth();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareType", 2); params.put("shareType", 2);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedGetShareSign); Response response = network.getResponse(params, BasicConfig.MOBILE_RedGetShareSign);
HashMap data = response.jsonPath().getJsonObject("data"); HashMap data = response.jsonPath().getJsonObject("data");
...@@ -95,7 +316,7 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -95,7 +316,7 @@ public class LiveVistorRed implements AdminAuthorization{
} }
/*访客端助力者-助力查询*/ /*访客端助力者-助力查询*/
@Test(description = "助力者助力查询", priority = 5) @Test(description = "助力者助力查询", priority = 19)
public void 助力者助力查询() public void 助力者助力查询()
{ {
visitorAuth2(); visitorAuth2();
...@@ -108,8 +329,8 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -108,8 +329,8 @@ public class LiveVistorRed implements AdminAuthorization{
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedHelpQuery, "帮好友助力失败", response.body().asString())); Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedHelpQuery, "帮好友助力失败", response.body().asString()));
} }
/*访客端助力者-帮好友助力1*/ /*访客端-帮好友助力*/
@Test(description = "帮好友助力", priority = 6) @Test(description = "帮好友助力", priority = 20)
public void 帮好友助力() public void 帮好友助力()
{ {
visitorAuth2(); visitorAuth2();
...@@ -123,25 +344,24 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -123,25 +344,24 @@ public class LiveVistorRed implements AdminAuthorization{
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedLuckHelp, "帮好友助力失败", response.body().asString())); Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedLuckHelp, "帮好友助力失败", response.body().asString()));
} }
/*访客端助力者-帮好友助力2*/ /*被助力者-手气王助力详情信息查询*/
@Test(description = "帮好友助力2", priority = 7) @Test(description = "红包详情助力信息", priority = 21)
public void 帮好友助力2() public void 红包详情助力信息()
{ {
visitorAuth(); visitorAuth();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("confId", confId_Red);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shareSign", red_sharesign); Response response = network.getResponse(params, BasicConfig.MOBILE_RedHelpDetail);
params.put("confRedPacketId", confId_Red); RedHepDetail data = JsonUtil.parseResponseToBean(response, RedHepDetail.class);
Response response = network.postResponse(params, BasicConfig.MOBILE_RedLuckHelp);
boolean data = response.jsonPath().getBoolean("success");
System.out.println(JSON.toJSONString(data)); System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedLuckHelp, "帮好友助力失败", response.body().asString())); Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedHelpDetail, "查询手气王助力失败", response.body().asString()));
} }
/*主播端发放普通红包*/ /*主播端发放手气王红包*/
@Test(description = "主播端发放普通红包", priority = 8) @Test(description = "主播端发放手气王红包", priority =22)
public void 主播端发放普通红包() public void 主播端发放手气王红包()
{ {
adminAuth(); adminAuth();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
...@@ -150,43 +370,28 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -150,43 +370,28 @@ public class LiveVistorRed implements AdminAuthorization{
Response response = network.postResponse(params, BasicConfig.MOBILE_RedStart); Response response = network.postResponse(params, BasicConfig.MOBILE_RedStart);
boolean data = response.jsonPath().getBoolean("data"); boolean data = response.jsonPath().getBoolean("data");
System.out.println(JSON.toJSONString(data)); System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedStart, "上架普通红包失败", response.body().asString())); Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedStart, "发放普通红包失败", response.body().asString()));
}
/*查询红包开始时间,倒计时*/
@Test(description = "查询红包开始时间", priority = 9)
public void 查询红包开始时间()
{
adminAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId",confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedGetSimple);
RedGetSimple Beans = JsonUtil.parseResponseToBean(response, RedGetSimple.class);
System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedGetSimple, "查询主播端发放红包开始时间失败", response.body().asString()));
} }
/*被助力者-红包助力详情信息查询*/ /*再次查询访客端红包状态*/
@Test(description = "红包详情助力信息", priority = 10) @Test(description = "再次查询红包状态", priority = 23)
public void 红包详情助力信息() public void 再次查询红包状态列表()
{ {
visitorAuth(); visitorAuth();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("confId", confId_Red);
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_RedHelpDetail); Response response = network.getResponse(params, BasicConfig.MOBILE_FindRedList);
RedHepDetail data = JsonUtil.parseResponseToBean(response, RedHepDetail.class); List<RedOrdinary> Beans = JsonUtil.parseResponseToListBean(response, RedOrdinary.class);
System.out.println(JSON.toJSONString(data)); System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedHelpDetail, "查询红包状态失败", response.body().asString())); Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_FindRedList, "查询红包状态失败", response.body().asString()));
} }
/*开红包*/ /*开手气王红包*/
@Test(description = "开红包", priority = 11) @Test(description = "开手气王红包", priority = 24)
public void 开红包() public void 手气王红包()
{ {
visitorAuth(); visitorAuth();
ThreadSleepUtils.sleep(60000); ThreadSleepUtils.sleep(63000);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red); params.put("confId", confId_Red);
...@@ -196,24 +401,9 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -196,24 +401,9 @@ public class LiveVistorRed implements AdminAuthorization{
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedOpen, "开红包失败", response.body().asString())); Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedOpen, "开红包失败", response.body().asString()));
} }
/*查询访客端手气王红包状态*/
/*领红包轮询结果*/ @Test(description = "手气王红包状态查询", priority = 25)
@Test(description = "领红包轮询结果", priority = 12) public void 手气王红包状态查询列表()
public void 领红包轮询结果()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_OpenState);
RedOpendate data=JsonUtil.parseResponseToBean(response, RedOpendate.class);
System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_OpenState, "领红包轮询结果查询失败", response.body().asString()));
}
/*查询访客端红包状态*/
@Test(description = "红包状态查询", priority = 13)
public void 红包状态查询列表()
{ {
visitorAuth(); visitorAuth();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
...@@ -224,64 +414,53 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -224,64 +414,53 @@ public class LiveVistorRed implements AdminAuthorization{
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_FindRedList, "查询红包状态失败", response.body().asString())); Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_FindRedList, "查询红包状态失败", response.body().asString()));
} }
@Test(description = "红包个数", priority = 14) /*领手气王红包结果查询*/
public void 红包个数() @Test(description = "领手气王红包结果查询", priority = 26)
public void 领手气王红包结果查询()
{ {
visitorAuth(); visitorAuth();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red); params.put("confId", confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedNum); Response response = network.getResponse(params, BasicConfig.MOBILE_RedState);
RedNum Beans = JsonUtil.parseResponseToBean(response, RedNum.class); RedState data=JsonUtil.parseResponseToBean(response, RedState.class);
System.out.println(JSON.toJSONString(Beans)); System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedNum, "查询红包个数失败", response.body().asString())); Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedState, "领红包结果查询失败", response.body().asString()));
} }
/*红包简介详情*/ /*手气王红包领取结果列表-看看大家手气*/
@Test(description = "红包简介详情", priority = 15) @Test(description = "查询手气王红包领取结果列表", priority = 27)
public void 红包查询列表() public void 查询手气王红包领取结果列表()
{ {
visitorAuth(); visitorAuth();
ThreadSleepUtils.sleep(15000);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red); params.put("confId", confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedFindSimpleDetail); params.put("pageIndex", 1);
RedSimpleDetail Beans = JsonUtil.parseResponseToBean(response, RedSimpleDetail.class); params.put("pageSize", 10);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedResultList);
RedSultList Beans = JsonUtil.parseResponseToBean(response, RedSultList.class);
System.out.println(JSON.toJSONString(Beans)); System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedFindSimpleDetail, "查询红包列表失败", response.body().asString())); Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedResultList, "查询红包领取结果列表", response.body().asString()));
}
/*获取红包小程序分享信息*/
@Test(description = "获取红包小程序分享信息", priority = 16)
public void 获取红包小程序分享信息()
{
visitorAuth();
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
Response response = network.getResponse(params, BasicConfig.MOBILE_GetRedMpShare);
System.out.println(JSON.toJSONString(response));
Assert.assertNotNull(response, network.message(params, BasicConfig.MOBILE_GetRedMpShare, "查询红包红包小程序分享信息", response.body().asString()));
} }
/*领红包轮询结果*/
/*领红包结果*/ @Test(description = "领手气王红包轮询结果", priority = 28)
@Test(description = "领红包结果", priority = 17) public void 领手气王红包轮询结果()
public void 领红包结果()
{ {
visitorAuth(); visitorAuth();
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey())); params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red); params.put("confId", confId_Red);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedState); Response response = network.getResponse(params, BasicConfig.MOBILE_OpenState);
RedState data=JsonUtil.parseResponseToBean(response, RedState.class); RedOpendate data=JsonUtil.parseResponseToBean(response, RedOpendate.class);
System.out.println(JSON.toJSONString(data)); System.out.println(JSON.toJSONString(data));
Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_RedState, "领红包结果查询失败", response.body().asString())); Assert.assertNotNull(data, network.message(params, BasicConfig.MOBILE_OpenState, "领手气王红包轮询结果查询失败", response.body().asString()));
} }
/*手气王公示*/ /*手气王公示*/
@Test(description = "手气王公示", priority = 18) @Test(description = "手气王公示", priority = 29)
public void 手气王公示() public void 手气王公示()
{ {
visitorAuth(); visitorAuth();
...@@ -295,26 +474,8 @@ public class LiveVistorRed implements AdminAuthorization{ ...@@ -295,26 +474,8 @@ public class LiveVistorRed implements AdminAuthorization{
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedLuckResult, "查询手气王公示失败", response.body().asString())); Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedLuckResult, "查询手气王公示失败", response.body().asString()));
} }
/*查询红包领取列表*/
@Test(description = "查询红包领取列表", priority = 19)
public void 查询红包领取列表()
{
visitorAuth();
ThreadSleepUtils.sleep(10000);
Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId", confId_Red);
params.put("pageIndex", 1);
params.put("pageSize", 10);
Response response = network.getResponse(params, BasicConfig.MOBILE_RedResultList);
RedLuckResult Beans = JsonUtil.parseResponseToBean(response, RedLuckResult.class);
System.out.println(JSON.toJSONString(Beans));
Assert.assertNotNull(Beans, network.message(params, BasicConfig.MOBILE_RedResultList, "查询红包领取列表失败", response.body().asString()));
}
/*主播端获取剩余红包金额*/ /*主播端获取剩余红包金额*/
@Test(description = "获取剩余红包金额", priority = 20) @Test(description = "获取剩余红包金额", priority = 30)
public void 获取剩余红包金额() public void 获取剩余红包金额()
{ {
adminAuth(); adminAuth();
......
...@@ -137,12 +137,13 @@ public class BasicConfig { ...@@ -137,12 +137,13 @@ public class BasicConfig {
//红包// //红包//
public static final String MOBILE_AnchorRedList = MOBILE_HOST + "/conf/live/red/findRedList"; public static final String MOBILE_AnchorRedList = MOBILE_HOST + "/conf/live/red/findRedList";
public static final String MOBILE_FindRedList = MOBILE_HOST + "/clue/red/findRedList";
public static final String MOBILE_RedFindDetail = MOBILE_HOST + "/conf/live/red/findRedDetail";
public static final String MOBILE_GetSurplusAmount = MOBILE_HOST + "/conf/live/red/getSurplusAmount"; public static final String MOBILE_GetSurplusAmount = MOBILE_HOST + "/conf/live/red/getSurplusAmount";
public static final String MOBILE_Grounding = MOBILE_HOST + "/conf/live/red/up"; public static final String MOBILE_Grounding = MOBILE_HOST + "/conf/live/red/up";
public static final String MOBILE_RedStart = MOBILE_HOST + "/conf/live/red/start"; public static final String MOBILE_RedStart = MOBILE_HOST + "/conf/live/red/start";
public static final String MOBILE_RedGetSimple = MOBILE_HOST + "/conf/live/red/getSimple"; public static final String MOBILE_RedGetSimple = MOBILE_HOST + "/conf/live/red/getSimple";
public static final String MOBILE_RedSaveOrUpdate = MOBILE_HOST + "/conf/live/red/saveOrUpdate"; public static final String MOBILE_RedSaveOrUpdate = MOBILE_HOST + "/conf/live/red/saveOrUpdate";
public static final String MOBILE_FindRedList = MOBILE_HOST + "/clue/red/findRedList";
public static final String MOBILE_RedFindSimpleDetail = MOBILE_HOST + "/clue/red/findSimpleDetail"; public static final String MOBILE_RedFindSimpleDetail = MOBILE_HOST + "/clue/red/findSimpleDetail";
public static final String MOBILE_RedHelpDetail = MOBILE_HOST + "/kjy/live/user/red/help/detail"; public static final String MOBILE_RedHelpDetail = MOBILE_HOST + "/kjy/live/user/red/help/detail";
public static final String MOBILE_GetRedMpShare = MOBILE_HOST + "/kjy/live/share/getRedMpShare"; public static final String MOBILE_GetRedMpShare = MOBILE_HOST + "/kjy/live/share/getRedMpShare";
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</classes> </classes>
</test> </test>
<test preserve-order="true" name="红包领取"> <test preserve-order="true" name="红包">
<classes> <classes>
<class name="com.kjj.cases.live.LiveVistorRed"/> <class name="com.kjj.cases.live.LiveVistorRed"/>
</classes> </classes>
......
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