Commit 737d1649 authored by 赵然's avatar 赵然

'zr'

parent 9eccb3ca
......@@ -3,7 +3,8 @@
* FileName: 瓜分积分测试_AccessTest
* Author: zhaoran
* Date: 2018/12/10 19:45
* Description: "appId": 21771
* AppId: 21827
* Description:
*/
package http.cases.PkMoudleTest;
......@@ -11,7 +12,6 @@ package http.cases.PkMoudleTest;
import base.DuibaLog;
import base.DuibaTestBase;
import com.alibaba.fastjson.JSONObject;
import http.model.BetMngVo;
import http.service.Activity.PkService;
import http.service.Manager.PkActivityService;
import http.service.hd.PkDevelopService;
......@@ -24,8 +24,8 @@ import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
......@@ -40,9 +40,9 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
private DuibaLog logger = DuibaLog.getLogger();
private static Integer uid1 = 5029;
private static Integer uid2 = 5058;
private static Integer uid3 = 5059;
private static Integer uid1 = 5080;
private static Integer uid2 = 5081;
private static Integer uid3 = 5086;
private static String betId;
private static String optionId1;
private static String optionId2;
......@@ -50,7 +50,7 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
@Test
public void 创建PK活动() throws Exception{
Response response = pkDevelopService.betEditor("21771","2","4",null,"1","30");
Response response = pkDevelopService.betEditor("21827","2","4","1","1","30");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk活动失败");
response = pkService.getBetList(uid1);
......@@ -98,7 +98,9 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
Response res2 = pkService.doJoin(uid2,betId,optionId1);
Response res3 = pkService.doJoin(uid3,betId,optionId2);
//查询数据库,投注前积分(抽奖扣积分流程校验)
Thread.sleep(5000);
//查询数据库,投注后积分(抽奖扣积分流程校验)
mapuser1 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid1);
mapuser2 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid2);
mapuser3 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid3);
......@@ -133,9 +135,9 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
logger.info("用户2开奖前积分:"+credits2);
logger.info("用户3开奖前积分:"+credits3);
//增加积分: 30/(2+2)
credits1 = String.valueOf(Integer.valueOf(credits1)+7);
credits2 = String.valueOf(Integer.valueOf(credits2)+7);
//增加积分:设置实际每人瓜分1积分
credits1 = String.valueOf(Integer.valueOf(credits1)+1);
credits2 = String.valueOf(Integer.valueOf(credits2)+1);
//修改开奖时间
this.modifyOpenPrizeTime(betId,60);
......@@ -174,9 +176,9 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
Assert.assertEquals(betGroupRelation.get("config_status").toString(),"4","pk关系表开奖状态更新失败");
logger.info("pk活动配置表状态更新为:"+betConfig.get("config_status").toString()+",pk关系表活动状态更新为:"+betGroupRelation.get("config_status").toString());
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0661 where consumer_id = '100112021' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"7","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0691 where consumer_id = '100112051' and duiba_activity_id = ?\n",betId);
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0723 where consumer_id = '100112083' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"1","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0724 where consumer_id = '100112084' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user02_order.get("add_credits").toString(),"","开奖后发奖值校验失败");
logger.info("用户01获取的积分值为:"+user01_order.get("add_credits").toString()+",用户03获取的积分值为:"+user02_order.get("add_credits").toString());
......@@ -194,9 +196,12 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
public void 出奖弹层校验() throws Exception {
Response response = pkService.popup(uid1);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"7","中奖弹窗积分校验失败");
//Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"1","中奖弹窗积分校验失败");
Assert.assertTrue(new BigDecimal(response.jsonPath().getString("data.prizeList[0].totalBonus")).compareTo(new BigDecimal("1"))==0,"中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"4","中奖弹窗类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败");
Assert.assertEquals(response.jsonPath().getString("data.unitName"),"金币","积分单位校验失败");
Response response2 = pkService.popup(uid3);
response.prettyPrint();
......@@ -206,6 +211,8 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
@Test(dependsOnMethods = { "出奖弹层校验" })
public void 战绩页校验() throws Exception {
Thread.sleep(10000);
Response response = pkService.list(uid1);
response.prettyPrint();
......@@ -221,20 +228,20 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].resultStatus"),"4","活动选项结果状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].optionId"),optionId1,"活动投注id1校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].rank"),"1","活动投注结果校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"4","活动投注人数校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.7","活动投注人数比例校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"4","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.7","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].resultStatus"),"4","活动选项结果状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].optionId"),optionId2,"活动投注id1校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].rank"),"2","活动投注结果校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"2","活动投注人数校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.3","活动投注人数比例校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"2","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.3","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.optionId"),optionId1,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.07","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"1","兑换状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.01","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"2","兑换状态校验失败");
response = pkService.list(uid3);
response.prettyPrint();
......@@ -256,12 +263,17 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
Boolean result5 = jdbc.update("delete from bet_activity.tb_bet_result where bet_id = ?",betId);
Boolean result2 = jdbc.update("delete from act_com_conf.tb_bet_group_relation where bet_id = ?",betId);
Boolean result3 = jdbc.update("delete from act_com_conf.tb_bet_config where id = ?",betId);
Boolean result6 = jdbc.update("delete from credits_dev.operating_activity where type = 53 and app_id = 21827");
Boolean result7 = jdbc.update("delete from act_com_conf.tb_bet_act_group where app_id = 21827");
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e){
e.printStackTrace();
}
}
public void modifyOpenPrizeTime(String betId,int x) throws Exception{
DateTime time1 = new DateTime();
......@@ -276,6 +288,4 @@ public class 瓜分积分_实际瓜分 extends DuibaTestBase {
Boolean result2 = jdbc.update("update act_com_conf.tb_bet_group_relation set end_time = ? where bet_id = ?\n",endTimeStr,betId);
}
}
\ No newline at end of file
......@@ -28,7 +28,7 @@ import java.sql.SQLException;
import java.util.Map;
public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBase {
public class 瓜分积分_实际瓜分_主胜方 extends DuibaTestBase {
@Autowired
PkDevelopService pkDevelopService;
......
......@@ -3,8 +3,7 @@
* FileName: 瓜分积分测试_AccessTest
* Author: zhaoran
* Date: 2018/12/10 19:45
* AppId: 21827
* Description:
* Description: "appId": 21771
*/
package http.cases.PkMoudleTest;
......@@ -12,6 +11,7 @@ package http.cases.PkMoudleTest;
import base.DuibaLog;
import base.DuibaTestBase;
import com.alibaba.fastjson.JSONObject;
import http.model.BetMngVo;
import http.service.Activity.PkService;
import http.service.Manager.PkActivityService;
import http.service.hd.PkDevelopService;
......@@ -24,12 +24,12 @@ import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
public class 瓜分积分_实际瓜分_废弃 extends DuibaTestBase {
@Autowired
PkDevelopService pkDevelopService;
......@@ -40,9 +40,9 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
private DuibaLog logger = DuibaLog.getLogger();
private static Integer uid1 = 5080;
private static Integer uid2 = 5081;
private static Integer uid3 = 5086;
private static Integer uid1 = 5029;
private static Integer uid2 = 5058;
private static Integer uid3 = 5059;
private static String betId;
private static String optionId1;
private static String optionId2;
......@@ -50,7 +50,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
@Test
public void 创建PK活动() throws Exception{
Response response = pkDevelopService.betEditor("21827","2","4","1","1","30");
Response response = pkDevelopService.betEditor("21771","2","4",null,"1","30");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk活动失败");
response = pkService.getBetList(uid1);
......@@ -98,9 +98,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Response res2 = pkService.doJoin(uid2,betId,optionId1);
Response res3 = pkService.doJoin(uid3,betId,optionId2);
Thread.sleep(5000);
//查询数据库,投注后积分(抽奖扣积分流程校验)
//查询数据库,投注前积分(抽奖扣积分流程校验)
mapuser1 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid1);
mapuser2 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid2);
mapuser3 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid3);
......@@ -135,9 +133,9 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
logger.info("用户2开奖前积分:"+credits2);
logger.info("用户3开奖前积分:"+credits3);
//增加积分:设置实际每人瓜分1积分
credits1 = String.valueOf(Integer.valueOf(credits1)+1);
credits2 = String.valueOf(Integer.valueOf(credits2)+1);
//增加积分: 30/(2+2)
credits1 = String.valueOf(Integer.valueOf(credits1)+7);
credits2 = String.valueOf(Integer.valueOf(credits2)+7);
//修改开奖时间
this.modifyOpenPrizeTime(betId,60);
......@@ -176,9 +174,9 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Assert.assertEquals(betGroupRelation.get("config_status").toString(),"4","pk关系表开奖状态更新失败");
logger.info("pk活动配置表状态更新为:"+betConfig.get("config_status").toString()+",pk关系表活动状态更新为:"+betGroupRelation.get("config_status").toString());
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0723 where consumer_id = '100112083' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"1","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0724 where consumer_id = '100112084' and duiba_activity_id = ?\n",betId);
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0661 where consumer_id = '100112021' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"7","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0691 where consumer_id = '100112051' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user02_order.get("add_credits").toString(),"","开奖后发奖值校验失败");
logger.info("用户01获取的积分值为:"+user01_order.get("add_credits").toString()+",用户03获取的积分值为:"+user02_order.get("add_credits").toString());
......@@ -196,12 +194,9 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
public void 出奖弹层校验() throws Exception {
Response response = pkService.popup(uid1);
response.prettyPrint();
//Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"1","中奖弹窗积分校验失败");
Assert.assertTrue(new BigDecimal(response.jsonPath().getString("data.prizeList[0].totalBonus")).compareTo(new BigDecimal("1"))==0,"中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"7","中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"4","中奖弹窗类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败");
Assert.assertEquals(response.jsonPath().getString("data.unitName"),"金币","积分单位校验失败");
Response response2 = pkService.popup(uid3);
response.prettyPrint();
......@@ -211,8 +206,6 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
@Test(dependsOnMethods = { "出奖弹层校验" })
public void 战绩页校验() throws Exception {
Thread.sleep(10000);
Response response = pkService.list(uid1);
response.prettyPrint();
......@@ -228,20 +221,20 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].resultStatus"),"4","活动选项结果状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].optionId"),optionId1,"活动投注id1校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].rank"),"1","活动投注结果校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"4","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.7","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"4","活动投注人数校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.7","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].resultStatus"),"4","活动选项结果状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].optionId"),optionId2,"活动投注id1校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].rank"),"2","活动投注结果校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"2","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.3","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"2","活动投注人数校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.3","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.optionId"),optionId1,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.01","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"2","兑换状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.07","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"1","兑换状态校验失败");
response = pkService.list(uid3);
response.prettyPrint();
......@@ -263,17 +256,12 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Boolean result5 = jdbc.update("delete from bet_activity.tb_bet_result where bet_id = ?",betId);
Boolean result2 = jdbc.update("delete from act_com_conf.tb_bet_group_relation where bet_id = ?",betId);
Boolean result3 = jdbc.update("delete from act_com_conf.tb_bet_config where id = ?",betId);
Boolean result6 = jdbc.update("delete from credits_dev.operating_activity where type = 53 and app_id = 21827");
Boolean result7 = jdbc.update("delete from act_com_conf.tb_bet_act_group where app_id = 21827");
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e){
e.printStackTrace();
}
}
public void modifyOpenPrizeTime(String betId,int x) throws Exception{
DateTime time1 = new DateTime();
......@@ -288,4 +276,6 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Boolean result2 = jdbc.update("update act_com_conf.tb_bet_group_relation set end_time = ? where bet_id = ?\n",endTimeStr,betId);
}
}
\ No newline at end of file
......@@ -21,6 +21,7 @@ import org.joda.time.format.DateTimeFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.math.BigDecimal;
......@@ -40,17 +41,37 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
private DuibaLog logger = DuibaLog.getLogger();
private static Integer uid1 = 5088;
private static Integer uid2 = 5089;
private static Integer uid3 = 5090;
private static Integer uid1 = 5144;
private static Integer uid2 = 5145;
private static Integer uid3 = 5146;
private static String betId;
private static String optionId1;
private static String optionId2;
//@BeforeClass
// public void beforeclass() {
// try {
// Map<String,Object> map = jdbc.findSimpleResult("SELECT * FROM credits_dev.operating_activity where type = 53 and app_id = 21829");
// String rel_id = String.valueOf(map.get("id"));
// Boolean result9 = jdbc.update("delete from act_com_conf.tb_red_account_period_rel where rel_id > ?",rel_id);
// } catch (Exception e){
// e.printStackTrace();
// }
// }
@Test
public void 创建PK活动() throws Exception{
Response response = pkDevelopService.betEditor("21828","1","2",null,"1","30");
logger.info("开始生成预算token");
Response response = pkDevelopService.temporaryCard("21829","2","5","10","2019-03-04T16:00:00.000Z","2029-03-22T16:00:00.000Z");
String token = response.jsonPath().getString("data.checkUuid");
logger.info("生成预算token为:"+token);
pkDevelopService.preSaveCheck("21829",token);
logger.info("预算确认成功!");
response = pkDevelopService.betEditor_red("21829",token,"1","2","0.01","0","10");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk_分红包活动失败");
response = pkService.getBetList(uid1);
......@@ -89,16 +110,14 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
logger.info("用户2投注前积分:"+credits2);
logger.info("用户3投注前积分:"+credits3);
//扣去1积分
credits1 = String.valueOf(Integer.valueOf(credits1)-1);
credits2 = String.valueOf(Integer.valueOf(credits2)-1);
credits3 = String.valueOf(Integer.valueOf(credits3)-1);
Response res1 = pkService.doJoin(uid1,betId,optionId1);
Response res2 = pkService.doJoin(uid2,betId,optionId1);
Response res3 = pkService.doJoin(uid3,betId,optionId2);
//查询数据库,投注前积分(抽奖扣积分流程校验)
Thread.sleep(5000);
//查询数据库,投注后积分(抽奖扣积分流程校验)
mapuser1 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid1);
mapuser2 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid2);
mapuser3 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid3);
......@@ -121,11 +140,11 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
@Test(dependsOnMethods = { "投注" })
public void 开奖() throws Exception {
//查询数据库,开奖前红包余额
Map<String,Object> user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0788 where consumer_id = '100112148' and account_type = '6'\n");
Map<String,Object> user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0830 where consumer_id = '100112190' and account_type = '6'\n");
String use1_Acc1 = user01_account1.get("balance_amount").toString();
Map<String,Object> user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0824 where consumer_id = '100112184' and account_type = '6'\n");
Map<String,Object> user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0838 where consumer_id = '100112198' and account_type = '6'\n");
String use2_Acc1 = user02_account1.get("balance_amount").toString();
Map<String,Object> user03_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0825 where consumer_id = '100112185' and account_type = '6'\n");
Map<String,Object> user03_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0839 where consumer_id = '100112199' and account_type = '6'\n");
String use3_Acc1 = user03_account1.get("balance_amount").toString();
......@@ -133,10 +152,10 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
logger.info("用户2开奖前红包余额:"+use2_Acc1);
logger.info("用户3开奖前红包余额:"+use3_Acc1);
//预期增加红包: 750
//预期增加红包: 1
DecimalFormat decimalFormat = new DecimalFormat("###################.###########");
use1_Acc1 = decimalFormat.format(this.sub(Double.valueOf(use1_Acc1),750));
use2_Acc1 = decimalFormat.format(this.sub(Double.valueOf(use2_Acc1),750));
use1_Acc1 = decimalFormat.format(this.sub(Double.valueOf(use1_Acc1),1));
use2_Acc1 = decimalFormat.format(this.sub(Double.valueOf(use2_Acc1),1));
//修改开奖时间
this.modifyOpenPrizeTime(betId,60);
......@@ -147,11 +166,11 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
Thread.sleep(8000);
//查询数据库,开奖后红包余额
user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0788 where consumer_id = '100112148' and account_type = '6'\n");
user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0830 where consumer_id = '100112190' and account_type = '6'\n");
String use1_Acc2 = user01_account1.get("balance_amount").toString();
user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0824 where consumer_id = '100112184' and account_type = '6'\n");
user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0838 where consumer_id = '100112198' and account_type = '6'\n");
String use2_Acc2 = user02_account1.get("balance_amount").toString();
user03_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0825 where consumer_id = '100112185' and account_type = '6'\n");
user03_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0839 where consumer_id = '100112199' and account_type = '6'\n");
String use3_Acc2 = user03_account1.get("balance_amount").toString();
logger.info("用户1开奖后积分:"+use1_Acc2);
......@@ -173,9 +192,9 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
Assert.assertEquals(betGroupRelation.get("config_status").toString(),"4","pk关系表开奖状态更新失败");
logger.info("pk活动配置表状态更新为:"+betConfig.get("config_status").toString()+",pk关系表活动状态更新为:"+betGroupRelation.get("config_status").toString());
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0788 where consumer_id = '100112148' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"750","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0825 where consumer_id = '100112185' and duiba_activity_id = ?\n",betId);
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0830 where consumer_id = '100112190' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"1","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0839 where consumer_id = '100112199' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user02_order.get("add_credits").toString(),"","开奖后发奖值校验失败");
logger.info("用户01获取的积分值为:"+user01_order.get("add_credits").toString()+",用户03获取的积分值为:"+user02_order.get("add_credits").toString());
......@@ -193,9 +212,11 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
public void 出奖弹层校验() throws Exception {
Response response = pkService.popup(uid1);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"750","中奖弹窗积分校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"1","中奖弹窗积分校验失败");
Assert.assertTrue(new BigDecimal(response.jsonPath().getString("data.prizeList[0].totalBonus")).compareTo(new BigDecimal("1"))==0,"中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"2","中奖弹窗类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.totalBonus"),"7.5","中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.totalBonus"),"0.01","中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败");
Response response2 = pkService.popup(uid3);
......@@ -206,14 +227,15 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
@Test(dependsOnMethods = { "出奖弹层校验" })
public void 战绩页校验() throws Exception {
Thread.sleep(10000);
Response response = pkService.list(uid1);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("data.list[0].userWin"),"true","中奖记录校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.id"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.shareExp"),"30","活动瓜分金额校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.shareExp"),"10","活动瓜分金额校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.configStatus"),"4","活动状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.creditsValue"),"1.00","活动消耗校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.creditsValue"),"0","活动消耗校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.betType"),"1","活动押注类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.bonusType"),"2","活动瓜分类型校验失败");
......@@ -221,19 +243,19 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].resultStatus"),"4","活动选项结果状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].optionId"),optionId1,"活动投注id1校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].rank"),"1","活动投注结果校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"4","活动投注人数校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.7","活动投注人数比例校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"544","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.9","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].resultStatus"),"4","活动选项结果状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].optionId"),optionId2,"活动投注id1校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].rank"),"2","活动投注结果校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"2","活动投注人数校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.3","活动投注人数比例校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"269","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.1","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.optionId"),optionId1,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"7.5","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.01","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"2","兑换状态校验失败");
response = pkService.list(uid3);
......@@ -251,11 +273,19 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
@AfterClass
public void afterclass() {
try {
// Map<String,Object> map = jdbc.findSimpleResult("SELECT * FROM act_com_conf.tb_red_account_period where app_id = 21829");
// String rel_id = String.valueOf(map.get("id"));
// Boolean result9 = jdbc.update("delete from act_com_conf.tb_red_account_period_rel where rel_id = ?",rel_id);
Boolean result1 = jdbc.update("delete from act_com_conf.tb_bet_option where bet_id = ?",betId);
Boolean result4 = jdbc.update("delete from act_record.tb_bet_record where bet_id = ?",betId);
Boolean result5 = jdbc.update("delete from bet_activity.tb_bet_result where bet_id = ?",betId);
Boolean result2 = jdbc.update("delete from act_com_conf.tb_bet_group_relation where bet_id = ?",betId);
Boolean result3 = jdbc.update("delete from act_com_conf.tb_bet_config where id = ?",betId);
Boolean result6 = jdbc.update("delete from credits_dev.operating_activity where type = 53 and app_id = 21829");
Boolean result7 = jdbc.update("delete from act_com_conf.tb_red_account_period where app_id = 21829");
Boolean result8 = jdbc.update("delete from act_com_conf.tb_bet_act_group where app_id = 21829");
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e){
......@@ -276,6 +306,7 @@ public class 瓜分红包_实际瓜分 extends DuibaTestBase {
Boolean result1 = jdbc.update("update act_com_conf.tb_bet_config set end_time = ? where id = ?\n",endTimeStr,betId);
Boolean result2 = jdbc.update("update act_com_conf.tb_bet_group_relation set end_time = ? where bet_id = ?\n",endTimeStr,betId);
Thread.sleep(60000);
}
/**
......
......@@ -21,7 +21,6 @@ import org.joda.time.format.DateTimeFormatter;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.math.BigDecimal;
......@@ -30,7 +29,7 @@ import java.text.DecimalFormat;
import java.util.Map;
public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
public class 瓜分红包_实际瓜分_废弃 extends DuibaTestBase {
@Autowired
PkDevelopService pkDevelopService;
......@@ -41,37 +40,17 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
private DuibaLog logger = DuibaLog.getLogger();
private static Integer uid1 = 5144;
private static Integer uid2 = 5145;
private static Integer uid3 = 5146;
private static Integer uid1 = 5088;
private static Integer uid2 = 5089;
private static Integer uid3 = 5090;
private static String betId;
private static String optionId1;
private static String optionId2;
//@BeforeClass
// public void beforeclass() {
// try {
// Map<String,Object> map = jdbc.findSimpleResult("SELECT * FROM credits_dev.operating_activity where type = 53 and app_id = 21829");
// String rel_id = String.valueOf(map.get("id"));
// Boolean result9 = jdbc.update("delete from act_com_conf.tb_red_account_period_rel where rel_id > ?",rel_id);
// } catch (Exception e){
// e.printStackTrace();
// }
// }
@Test
public void 创建PK活动() throws Exception{
logger.info("开始生成预算token");
Response response = pkDevelopService.temporaryCard("21829","2","5","10","2019-03-04T16:00:00.000Z","2029-03-22T16:00:00.000Z");
String token = response.jsonPath().getString("data.checkUuid");
logger.info("生成预算token为:"+token);
pkDevelopService.preSaveCheck("21829",token);
logger.info("预算确认成功!");
response = pkDevelopService.betEditor_red("21829",token,"1","2","0.01","0","10");
Response response = pkDevelopService.betEditor("21828","1","2",null,"1","30");
Assert.assertEquals(response.jsonPath().getString("desc"),"成功","创建组件化pk_分红包活动失败");
response = pkService.getBetList(uid1);
......@@ -110,14 +89,16 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
logger.info("用户2投注前积分:"+credits2);
logger.info("用户3投注前积分:"+credits3);
//扣去1积分
credits1 = String.valueOf(Integer.valueOf(credits1)-1);
credits2 = String.valueOf(Integer.valueOf(credits2)-1);
credits3 = String.valueOf(Integer.valueOf(credits3)-1);
Response res1 = pkService.doJoin(uid1,betId,optionId1);
Response res2 = pkService.doJoin(uid2,betId,optionId1);
Response res3 = pkService.doJoin(uid3,betId,optionId2);
Thread.sleep(5000);
//查询数据库,投注后积分(抽奖扣积分流程校验)
//查询数据库,投注前积分(抽奖扣积分流程校验)
mapuser1 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid1);
mapuser2 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid2);
mapuser3 = jdbc.findSimpleResult("select * from dafuweng.user where id="+uid3);
......@@ -140,11 +121,11 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
@Test(dependsOnMethods = { "投注" })
public void 开奖() throws Exception {
//查询数据库,开奖前红包余额
Map<String,Object> user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0830 where consumer_id = '100112190' and account_type = '6'\n");
Map<String,Object> user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0788 where consumer_id = '100112148' and account_type = '6'\n");
String use1_Acc1 = user01_account1.get("balance_amount").toString();
Map<String,Object> user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0838 where consumer_id = '100112198' and account_type = '6'\n");
Map<String,Object> user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0824 where consumer_id = '100112184' and account_type = '6'\n");
String use2_Acc1 = user02_account1.get("balance_amount").toString();
Map<String,Object> user03_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0839 where consumer_id = '100112199' and account_type = '6'\n");
Map<String,Object> user03_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0825 where consumer_id = '100112185' and account_type = '6'\n");
String use3_Acc1 = user03_account1.get("balance_amount").toString();
......@@ -152,10 +133,10 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
logger.info("用户2开奖前红包余额:"+use2_Acc1);
logger.info("用户3开奖前红包余额:"+use3_Acc1);
//预期增加红包: 1
//预期增加红包: 750
DecimalFormat decimalFormat = new DecimalFormat("###################.###########");
use1_Acc1 = decimalFormat.format(this.sub(Double.valueOf(use1_Acc1),1));
use2_Acc1 = decimalFormat.format(this.sub(Double.valueOf(use2_Acc1),1));
use1_Acc1 = decimalFormat.format(this.sub(Double.valueOf(use1_Acc1),750));
use2_Acc1 = decimalFormat.format(this.sub(Double.valueOf(use2_Acc1),750));
//修改开奖时间
this.modifyOpenPrizeTime(betId,60);
......@@ -166,11 +147,11 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
Thread.sleep(8000);
//查询数据库,开奖后红包余额
user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0830 where consumer_id = '100112190' and account_type = '6'\n");
user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0788 where consumer_id = '100112148' and account_type = '6'\n");
String use1_Acc2 = user01_account1.get("balance_amount").toString();
user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0838 where consumer_id = '100112198' and account_type = '6'\n");
user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0824 where consumer_id = '100112184' and account_type = '6'\n");
String use2_Acc2 = user02_account1.get("balance_amount").toString();
user03_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0839 where consumer_id = '100112199' and account_type = '6'\n");
user03_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0825 where consumer_id = '100112185' and account_type = '6'\n");
String use3_Acc2 = user03_account1.get("balance_amount").toString();
logger.info("用户1开奖后积分:"+use1_Acc2);
......@@ -192,9 +173,9 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
Assert.assertEquals(betGroupRelation.get("config_status").toString(),"4","pk关系表开奖状态更新失败");
logger.info("pk活动配置表状态更新为:"+betConfig.get("config_status").toString()+",pk关系表活动状态更新为:"+betGroupRelation.get("config_status").toString());
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0830 where consumer_id = '100112190' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"1","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0839 where consumer_id = '100112199' and duiba_activity_id = ?\n",betId);
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0788 where consumer_id = '100112148' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"750","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0825 where consumer_id = '100112185' and duiba_activity_id = ?\n",betId);
Assert.assertEquals(user02_order.get("add_credits").toString(),"","开奖后发奖值校验失败");
logger.info("用户01获取的积分值为:"+user01_order.get("add_credits").toString()+",用户03获取的积分值为:"+user02_order.get("add_credits").toString());
......@@ -212,11 +193,9 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
public void 出奖弹层校验() throws Exception {
Response response = pkService.popup(uid1);
response.prettyPrint();
// Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"1","中奖弹窗积分校验失败");
Assert.assertTrue(new BigDecimal(response.jsonPath().getString("data.prizeList[0].totalBonus")).compareTo(new BigDecimal("1"))==0,"中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"750","中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"2","中奖弹窗类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.totalBonus"),"0.01","中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.totalBonus"),"7.5","中奖弹窗积分校验失败");
Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败");
Response response2 = pkService.popup(uid3);
......@@ -227,15 +206,14 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
@Test(dependsOnMethods = { "出奖弹层校验" })
public void 战绩页校验() throws Exception {
Thread.sleep(10000);
Response response = pkService.list(uid1);
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("data.list[0].userWin"),"true","中奖记录校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.id"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.shareExp"),"10","活动瓜分金额校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.shareExp"),"30","活动瓜分金额校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.configStatus"),"4","活动状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.creditsValue"),"0","活动消耗校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.creditsValue"),"1.00","活动消耗校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.betType"),"1","活动押注类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].betConfig.bonusType"),"2","活动瓜分类型校验失败");
......@@ -243,19 +221,19 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].resultStatus"),"4","活动选项结果状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].optionId"),optionId1,"活动投注id1校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].rank"),"1","活动投注结果校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"544","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.9","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].betTimes"),"4","活动投注人数校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[0].scale"),"66.7","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].resultStatus"),"4","活动选项结果状态校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].optionId"),optionId2,"活动投注id1校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].rank"),"2","活动投注结果校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"269","活动投注人数校验失败");
// Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.1","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].betTimes"),"2","活动投注人数校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].options[1].scale"),"33.3","活动投注人数比例校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.betId"),betId,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.optionId"),optionId1,"活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"0.01","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.bonus"),"7.5","活动id校验失败");
Assert.assertEquals(response.jsonPath().getString("data.list[0].record.exchangeStatus"),"2","兑换状态校验失败");
response = pkService.list(uid3);
......@@ -273,19 +251,11 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
@AfterClass
public void afterclass() {
try {
// Map<String,Object> map = jdbc.findSimpleResult("SELECT * FROM act_com_conf.tb_red_account_period where app_id = 21829");
// String rel_id = String.valueOf(map.get("id"));
// Boolean result9 = jdbc.update("delete from act_com_conf.tb_red_account_period_rel where rel_id = ?",rel_id);
Boolean result1 = jdbc.update("delete from act_com_conf.tb_bet_option where bet_id = ?",betId);
Boolean result4 = jdbc.update("delete from act_record.tb_bet_record where bet_id = ?",betId);
Boolean result5 = jdbc.update("delete from bet_activity.tb_bet_result where bet_id = ?",betId);
Boolean result2 = jdbc.update("delete from act_com_conf.tb_bet_group_relation where bet_id = ?",betId);
Boolean result3 = jdbc.update("delete from act_com_conf.tb_bet_config where id = ?",betId);
Boolean result6 = jdbc.update("delete from credits_dev.operating_activity where type = 53 and app_id = 21829");
Boolean result7 = jdbc.update("delete from act_com_conf.tb_red_account_period where app_id = 21829");
Boolean result8 = jdbc.update("delete from act_com_conf.tb_bet_act_group where app_id = 21829");
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e){
......@@ -306,7 +276,6 @@ public class 瓜分红包_实际瓜分_AccessTest extends DuibaTestBase {
Boolean result1 = jdbc.update("update act_com_conf.tb_bet_config set end_time = ? where id = ?\n",endTimeStr,betId);
Boolean result2 = jdbc.update("update act_com_conf.tb_bet_group_relation set end_time = ? where bet_id = ?\n",endTimeStr,betId);
Thread.sleep(60000);
}
/**
......
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