Commit 646c5ee7 authored by 张艳玲's avatar 张艳玲

update

parent 4ed34f02
package com.kjj.bean.manager;
import lombok.Data;
@Data
public class PassQues {
private String optionDetail;
public Integer optionType;
private Integer id;
}
......@@ -1733,8 +1733,140 @@ public class SaveLive implements Authorization {
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_redSwitchStatus, "开启攒现金红包配置失败", response.body().asString()));
}
/**
* 闯关答题
*/
@Test(description = "新增闯关答题配置", priority = 94)
public void 新增闯关答题配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("openTime",10);
List<PassQues> optionLists =new ArrayList<>();
PassQues optionList =new PassQues();
optionList.setOptionDetail("正确选项");
optionList.setOptionType(1);
optionLists.add(optionList);
PassQues optionList1 =new PassQues();
optionList1.setOptionDetail("错误选项");
optionList1.setOptionType(2);
optionLists.add(optionList1);
Params.put("optionList",optionLists);
Params.put("passQuestion","闯关答题配置");
Response response = network.postResponse(Params, BasicConfig.MANAGER_addOrUpdateQues);
boolean data =response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_addOrUpdateQues, "新增闯关答题配置失败", response.body().asString()));
Map<String, Object> addPassParam = new HashMap<>();
addPassParam.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
addPassParam.put("openTime",10);
List<PassQues> optionLists1 =new ArrayList<>();
PassQues optionList2 =new PassQues();
optionList2.setOptionDetail("正确选项");
optionList2.setOptionType(1);
optionLists1.add(optionList2);
PassQues optionList3 =new PassQues();
optionList3.setOptionDetail("错误选项");
optionList3.setOptionType(2);
optionLists1.add(optionList3);
addPassParam.put("optionList",optionLists1);
addPassParam.put("passQuestion","闯关答题配置");
Response passRes = network.postResponse(addPassParam, BasicConfig.MANAGER_addOrUpdateQues);
boolean data1 =passRes.jsonPath().getBoolean("data");
System.out.println(data1);
Assert.assertTrue(data1, network.message(addPassParam, BasicConfig.MANAGER_addOrUpdateQues, "新增闯关答题配置失败", passRes.body().asString()));
}
public List<PassQues> quesId;
@Test(description = "获取问题列表", priority = 95)
public void 获取问题列表() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_quesList);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
List<PassQues> list=JsonUtil.parseResponseToListBean(response,PassQues.class);
this.quesId=list;
Assert.assertNotNull(list, network.message(Params, BasicConfig.MANAGER_quesList, "查询问题列表失败", response.body().asString()));
}
@Test(description = "获取问题详情", priority = 96)
public void 获取问题详情() {
Map<String, Object> Params = new HashMap<>();
Params.put("quesId", this.quesId.get(0).getId());
Response response = network.getResponse(Params, BasicConfig.MANAGER_quesInfo);
int id = response.jsonPath().getInt("data.id");
System.out.println(id);
Assert.assertTrue(id==this.quesId.get(0).getId(), network.message(Params, BasicConfig.MANAGER_quesInfo, "获取问题详情失败", response.body().asString()));
}
@Test(description = "删除闯关答题配置", priority = 97)
public void 删除闯关答题配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("quesId", this.quesId.get(1).getId());
Response response = network.postResponse(Params, BasicConfig.MANAGER_deleteQues);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_deleteQues, "删除闯关答题配置失败", response.body().asString()));
}
@Test(description = "获取直播红包配置", priority = 98)
public void 获取直播红包配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_getSurplusAmount);
int data = response.jsonPath().getInt("data");
System.out.println(data);
Assert.assertTrue(data>0, network.message(Params, BasicConfig.MANAGER_getSurplusAmount, "获取直播红包配置失败", response.body().asString()));
}
@Test(description = "新增闯关红包配置", priority = 99)
public void 新增闯关红包配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Params.put("amount",1000);
Params.put("carveTime",1);
Params.put("showAmount",1000);
Response response = network.postResponse(Params, BasicConfig.MANAGER_addOrUpdateConf);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_addOrUpdateConf, "新增闯关红包配置失败", response.body().asString()));
}
public int redConfId;
@Test(description = "获取红包配置详情", priority = 100)
public void 获取红包配置详情() {
Map<String, Object> Params = new HashMap<>();
Params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.LIVE_ID.getKey()));
Response response = network.getResponse(Params, BasicConfig.MANAGER_redConfInfo);
Object data = response.jsonPath().getJsonObject("data");
System.out.println(data);
PassQues confId= JsonUtil.parseResponseToBean(response,PassQues.class);
redConfId = confId.getId();
Assert.assertNotNull(confId, network.message(Params, BasicConfig.MANAGER_redConfInfo, "获取红包配置详情失败", response.body().asString()));
}
@Test(description = "开启闯关红包配置", priority = 101)
public void 开启闯关红包配置() {
Map<String, Object> Params = new HashMap<>();
Params.put("id", redConfId);
Params.put("openStatus",1);
Response response = network.postResponse(Params, BasicConfig.MANAGER_switchOpen);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
Assert.assertTrue(data, network.message(Params, BasicConfig.MANAGER_switchOpen, "获取红包配置详情失败", response.body().asString()));
}
......
......@@ -61,8 +61,8 @@ public class BasicConfig {
//***********************************************************************
// 基础线代理人 TKU,ID:
public static String AGENT_TKU = "T3gM31f18jCFEcfoYxvVk1LsF5T1YkcBNDbUaryi3TgvwatuP6mroJjZ2k7iCHjC9Srujh7k311i3vFuZm";
// 基础线代理人 TKU,sid:2991
public static String AGENT_TKU = "T3gM31f18jCFEcfTyJdjfJAfSjDmKNMHfH7CvpLDC6UCQd8X84RJEiiPHRHPqbrJYL3KL7tLsZEM5LjN4z";
// 基础线访客 TKU
public static String VISITOR_TKU = "T3gM31f18jCGvqvoyJRzyMTdpcPDJWUJJP4VQje7p9sfHcRNmyhTEzEbfmwrGFy5doVEinb1k3SVwreYQE";
// 访客的sids
......@@ -90,6 +90,16 @@ public class BasicConfig {
public static final String ANCHOR_getConfDetail = MOBILE_HOST + "/conf/pre/getConfDetail";
public static final String ANCHOR_CLOSE = MOBILE_HOST + "/conf/live/close";
// *************** 闯关答题 ***************
public static final String MANAGER_addOrUpdateQues = MANAGER_HOST + "/kjy/manager/pass/ques/addOrUpdateQues";
public static final String MANAGER_deleteQues = MANAGER_HOST + "/kjy/manager/pass/ques/deleteQues";
public static final String MANAGER_quesList = MANAGER_HOST + "/kjy/manager/pass/ques/quesList";
public static final String MANAGER_quesInfo = MANAGER_HOST + "/kjy/manager/pass/ques/quesInfo";
public static final String MANAGER_addOrUpdateConf = MANAGER_HOST + "/kjy/manager/pass/ques/addOrUpdateConf";
public static final String MANAGER_redConfInfo = MANAGER_HOST + "/kjy/manager/pass/ques/redConfInfo";
public static final String MANAGER_switchOpen = MANAGER_HOST + "/kjy/manager/pass/ques/switchOpen";
// *************** 看直播攒现金红包 ***************
public static final String MANAGER_timeRed = MANAGER_HOST + "/kjy/manager/live/time/red/saveOrUpdateFirst";
public static final String MANAGER_timeRedList = MANAGER_HOST + "/kjy/manager/live/time/red/list";
......
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