Commit 67f3e4ad authored by 张艳玲's avatar 张艳玲

新增猜数字红包

parent 16f9382c
package com.kjj.bean.manager;
import lombok.Data;
@Data
public class GuessList {
private String confId;
private Integer redSort;
}
This diff is collapsed.
......@@ -150,7 +150,9 @@ public class Limited implements AdminAuthorization {
ThreadSleepUtils.sleep(500);
Map<String, Object> params = new HashMap<>();
params.put("liveId",LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("confId",this.quesConfId.get(0).getQuesConfId());
String quesConfId = this.quesConfId.get(0).getQuesConfId();
params.put("confId",quesConfId);
System.out.println("quesConfId:"+quesConfId);
Response response = network.postResponse(params, BasicConfig.MOBILE_QuesRewardStart);
boolean data = response.jsonPath().getBoolean("data");
System.out.println(data);
......@@ -227,8 +229,9 @@ public class Limited implements AdminAuthorization {
ThreadSleepUtils.sleep(5000);
Map<String, Object> params = new HashMap<>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("quesConfId",this.quesConfId.get(0).getQuesConfId());
System.out.println(" 查询用户A领取答题红包结果 timestamp:"+new Date().getTime());
String quesConfId = this.quesConfId.get(0).getQuesConfId();
params.put("quesConfId",quesConfId);
System.out.println(" 查询用户A领取答题红包结果 timestamp:"+new Date().getTime()+"quesConfId:"+quesConfId);
Response response = network.getResponse(params, BasicConfig.MOBILE_QuesParticipateInfo);
boolean result=response.jsonPath().getBoolean("data.result");
System.out.println(result);
......@@ -236,6 +239,7 @@ public class Limited implements AdminAuthorization {
Integer amount = response.jsonPath().getJsonObject("data.amount");
System.out.println(amount);
Assert.assertTrue(amount>0,network.message(params, BasicConfig.MOBILE_QuesParticipateInfo, "用户答题结果获取失败", response.body().asString()));
}
......
......@@ -84,6 +84,21 @@ public class BasicConfig {
public static final String ANCHOR_listLiveFreeReward = MOBILE_HOST + "/kjy/live/lottery/listLiveFreeReward";
public static final String ANCHOR_receive = MOBILE_HOST + "/kjy/live/user/lottery/receive";
// *************** 猜数字红包 ***************
public static final String MANAGER_getSurplusAmount = MANAGER_HOST + "/kjy/manager/red/conf/getSurplusAmount";
public static final String MANAGER_saveOrUpdate1 = MANAGER_HOST + "/kjy/manager/red/guess/saveOrUpdate";
public static final String MANAGER_list_1 = MANAGER_HOST + "/kjy/manager/red/guess/list";
public static final String MANAGER_detail_1 = MANAGER_HOST + "/kjy/manager/red/guess/detail";
public static final String MANAGER_del_1 = MANAGER_HOST + "/kjy/manager/red/guess/delete";
//助播端
public static final String MOBILE_saveOrUpdate = MOBILE_HOST + "/conf/pre/red/guess/saveOrUpdate";
public static final String MOBILE_findDetail = MOBILE_HOST + "/conf/pre/red/findDetail";
public static final String MOBILE_list = MOBILE_HOST + "/conf/pre/red/guess/list";
public static final String MOBILE_detail = MOBILE_HOST + "/conf/pre/red/guess/detail";
public static final String MOBILE_delete = MOBILE_HOST + "/conf/pre/red/guess/delete";
// *************** 宝箱裂变 ***************
public static final String MANAGER_getList4Admin = MANAGER_HOST + "/kjy/manager/welfare/pre/conf/getList4Admin";
public static final String MANAGER_saveTreasureConf = MANAGER_HOST + "/kjy/manager/live/treasure/saveTreasureConf";
......
......@@ -7,6 +7,7 @@ import groovy.json.JsonBuilder;
import io.restassured.response.Response;
import java.util.List;
import java.util.Map;
public class JsonUtil {
......@@ -47,6 +48,13 @@ public class JsonUtil {
return JSON.parseArray(str, tClass);
}
public static <T> List<T> parseResponseToListBean(Response response, Class<T> tClass, String listName){
Map map = response.jsonPath().getJsonObject("data");
Object data = map.get(listName);
String str = new JsonBuilder(data).toString();
return JSON.parseArray(str, tClass);
}
public static <T> T parseResponseToBean1(Response response, Class<T> tClass){
Object data = response.jsonPath().getJsonObject("d");
String str = new JsonBuilder(data).toString();
......
......@@ -25,11 +25,17 @@
</classes>
</test>
<test preserve-order="true" name="宝箱裂变">
<classes>
<class name="com.kjj.cases.live.treasure.Treasure"/>
</classes>
</test>
<test preserve-order="true" name="宝箱裂变">
<classes>
<class name="com.kjj.cases.live.treasure.Treasure"/>
</classes>
</test>
<test preserve-order="true" name="直播前猜数字红包配置">
<classes>
<class name="com.kjj.cases.live.guess.ManagerGuess"/>
</classes>
</test>
<test preserve-order="true" name="宝箱时长">
......
......@@ -2,6 +2,7 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="客集集" verbose="1" thread-count="3">
<suite-files>
<suite-file path="liveTestNG.xml"></suite-file>
<suite-file path="wechatTestNG.xml"></suite-file>
......
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