Commit 6ba7ee76 authored by 钱雯君's avatar 钱雯君

add

parent ec56d0af
...@@ -93,6 +93,15 @@ public class pk_开奖_瓜分红包_押注人数不同测试_PkTest extends Duib ...@@ -93,6 +93,15 @@ public class pk_开奖_瓜分红包_押注人数不同测试_PkTest extends Duib
optionsIds.add(pks.get(i).get("id").toString()); optionsIds.add(pks.get(i).get("id").toString());
} }
logger.info("pk活动id为:"+newBetId+",选项id为:"+ optionsIds.toString()); logger.info("pk活动id为:"+newBetId+",选项id为:"+ optionsIds.toString());
Map<String,Object> user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0060 where consumer_id = '100066364' and account_type = '6'\n");
Long use1_Acc1 = Long.valueOf(user01_account1.get("balance_amount").toString());
Map<String,Object> user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0061 where consumer_id = '100066365' and account_type = '6'\n");
Long use2_Acc1 = Long.valueOf(user02_account1.get("balance_amount").toString());
Map<String,Object> user03_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0062 where consumer_id = '100066366' and account_type = '6'\n");
Long use3_Acc1 = Long.valueOf(user03_account1.get("balance_amount").toString());
Map<String,Object> user04_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0063 where consumer_id = '100066367' and account_type = '6'\n");
Long use4_Acc1 = Long.valueOf(user04_account1.get("balance_amount").toString());
//押注第一个选项:user01,user02 //押注第一个选项:user01,user02
//押注第二个选项:user03,user04 //押注第二个选项:user03,user04
...@@ -147,7 +156,18 @@ public class pk_开奖_瓜分红包_押注人数不同测试_PkTest extends Duib ...@@ -147,7 +156,18 @@ public class pk_开奖_瓜分红包_押注人数不同测试_PkTest extends Duib
Assert.assertTrue(bet1Times<bet2Times,"活动获胜人数比失败人数多校验失败"); Assert.assertTrue(bet1Times<bet2Times,"活动获胜人数比失败人数多校验失败");
logger.info("选项1的押注人数为:"+bet1Result.get("bet_times").toString()+",选项2的押注人数为:"+bet2Result.get("bet_times").toString()); logger.info("选项1的押注人数为:"+bet1Result.get("bet_times").toString()+",选项2的押注人数为:"+bet2Result.get("bet_times").toString());
Map<String,Object> user01_account = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0060 where consumer_id = '100066364' and duiba_activity_id = ?\n",newBetId); Map<String,Object> user01_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0060 where consumer_id = '100066364' and account_type = '6'\n");
Long use1_Acc2 = Long.valueOf(user01_account2.get("balance_amount").toString());
Assert.assertEquals(use1_Acc2,use1_Acc1,"用户1入账校验失败");
Map<String,Object> user02_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0061 where consumer_id = '100066365' and account_type = '6'\n");
Long use2_Acc2 = Long.valueOf(user02_account2.get("balance_amount").toString());
Assert.assertEquals(use2_Acc2.toString(),String.valueOf(use2_Acc1+10),"用户2入账校验失败");
Map<String,Object> user03_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0062 where consumer_id = '100066366' and account_type = '6'\n");
Long use3_Acc2 = Long.valueOf(user03_account2.get("balance_amount").toString());
Assert.assertEquals(use3_Acc2.toString(),String.valueOf(use3_Acc1+10),"用户3入账校验失败");
Map<String,Object> user04_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0063 where consumer_id = '100066367' and account_type = '6'\n");
Long use4_Acc2 = Long.valueOf(user04_account2.get("balance_amount").toString());
Assert.assertEquals(use4_Acc2.toString(),String.valueOf(use4_Acc1+10),"用户4入账校验失败");
......
...@@ -50,14 +50,10 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib ...@@ -50,14 +50,10 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib
private String groupId = "7"; private String groupId = "7";
private Integer user01 = 3445; private Integer user01 = 4782;
private String consumerId01 = "100066364";//activity_order_con.tb_trade_center_activity_order_0060 private String consumerId01 = "100107000";//activity_order_con.tb_trade_center_activity_order_0760
private Integer user02 = 3446; private Integer user02 = 4783;
private String consumerId02 = "100066365";//activity_order_con.tb_trade_center_activity_order_0061 private String consumerId02 = "100107001";//activity_order_con.tb_trade_center_activity_order_0761
private Integer user03 = 3447;
private String consumerId03 = "100066366";//activity_order_con.tb_trade_center_activity_order_0062
private Integer user04 = 3448;
private String consumerId04 = "100066367";//activity_order_con.tb_trade_center_activity_order_0063
private String newBetId = ""; private String newBetId = "";
...@@ -87,12 +83,16 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib ...@@ -87,12 +83,16 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib
} }
logger.info("pk活动id为:"+newBetId+",选项id为:"+ optionsIds.toString()); logger.info("pk活动id为:"+newBetId+",选项id为:"+ optionsIds.toString());
Map<String,Object> user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0760 where consumer_id = '100107000' and account_type = '6'\n");
Long use1_Acc1 = Long.valueOf(user01_account1.get("balance_amount").toString());
Map<String,Object> user02_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0761 where consumer_id = '100107001' and account_type = '6'\n");
Long use2_Acc1 = Long.valueOf(user02_account1.get("balance_amount").toString());
//押注第一个选项:user01,user02 //押注第一个选项:user01,user02
//押注第二个选项:user03,user04 //押注第二个选项:user03,user04
Response res1 = pkService.doJoin(user01,newBetId,optionsIds.get(0)); Response res1 = pkService.doJoin(user01,newBetId,optionsIds.get(0));
Response res2 = pkService.doJoin(user02,newBetId,optionsIds.get(0)); Response res2 = pkService.doJoin(user02,newBetId,optionsIds.get(1));
Response res3 = pkService.doJoin(user03,newBetId,optionsIds.get(1));
Response res4 = pkService.doJoin(user04,newBetId,optionsIds.get(1));
//修改开奖时间 //修改开奖时间
this.modifyOpenPrizeTime(newBetId,120); this.modifyOpenPrizeTime(newBetId,120);
...@@ -120,16 +120,11 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib ...@@ -120,16 +120,11 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib
} }
} }
Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0060 where consumer_id = '100066364' and duiba_activity_id = ?\n",newBetId); Map<String,Object> user01_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0760 where consumer_id = '100107000' and duiba_activity_id = ?\n",newBetId);
Assert.assertEquals(user01_order.get("add_credits").toString(),"10","开奖后发奖值校验失败"); Assert.assertEquals(user01_order.get("add_credits").toString(),"10","开奖后发奖值校验失败");
Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0061 where consumer_id = '100066365' and duiba_activity_id = ?\n",newBetId); Map<String,Object> user02_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0761 where consumer_id = '100107001' and duiba_activity_id = ?\n",newBetId);
Assert.assertEquals(user02_order.get("add_credits").toString(),"10","开奖后发奖值校验失败"); Assert.assertEquals(user02_order.get("add_credits").toString(),"","开奖后发奖值校验失败");
Map<String,Object> user03_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0062 where consumer_id = '100066366' and duiba_activity_id = ?\n",newBetId);
Assert.assertEquals(user03_order.get("add_credits").toString(),"","开奖后发奖值校验失败");
Map<String,Object> user04_order = jdbc.findSimpleResult("select * from activity_order_con.tb_trade_center_activity_order_0063 where consumer_id = '100066367' and duiba_activity_id = ?\n",newBetId);
Assert.assertEquals(user04_order.get("add_credits").toString(),"","开奖后发奖值校验失败");
logger.info("用户01获取的红包值为:"+user01_order.get("add_credits").toString()+",用户02获取的红包值为:"+user02_order.get("add_credits").toString()); logger.info("用户01获取的红包值为:"+user01_order.get("add_credits").toString()+",用户02获取的红包值为:"+user02_order.get("add_credits").toString());
logger.info("用户03获取的红包值为:"+user03_order.get("add_credits").toString()+",用户04获取的红包值为:"+user04_order.get("add_credits").toString());
Map<String,Object> bet1Result = jdbc.findSimpleResult("select * from bet_activity.tb_bet_result where bet_id = ? and option_id = ?\n",newBetId,optionsIds.get(0)); Map<String,Object> bet1Result = jdbc.findSimpleResult("select * from bet_activity.tb_bet_result where bet_id = ? and option_id = ?\n",newBetId,optionsIds.get(0));
Assert.assertEquals(bet1Result.get("rank").toString(),"1","开始押注的选项获胜校验失败"); Assert.assertEquals(bet1Result.get("rank").toString(),"1","开始押注的选项获胜校验失败");
...@@ -140,6 +135,13 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib ...@@ -140,6 +135,13 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib
Assert.assertTrue(bet1Times>bet2Times,"活动获胜人数比失败人数多校验失败"); Assert.assertTrue(bet1Times>bet2Times,"活动获胜人数比失败人数多校验失败");
logger.info("选项1的押注人数为:"+bet1Result.get("bet_times").toString()+",选项2的押注人数为:"+bet2Result.get("bet_times").toString()); logger.info("选项1的押注人数为:"+bet1Result.get("bet_times").toString()+",选项2的押注人数为:"+bet2Result.get("bet_times").toString());
Map<String,Object> user01_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0760 where consumer_id = '100107000' and account_type = '6'\n");
Long use1_Acc2 = Long.valueOf(user01_account2.get("balance_amount").toString());
Assert.assertEquals(use1_Acc2.toString(),String.valueOf(use1_Acc1+10),"用户2入账校验失败");
Map<String,Object> user02_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0761 where consumer_id = '100107001' and account_type = '6'\n");
Long use2_Acc2 = Long.valueOf(user02_account2.get("balance_amount").toString());
Assert.assertEquals(use2_Acc2,use2_Acc1,"用户2入账校验失败");
} }
...@@ -148,7 +150,9 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib ...@@ -148,7 +150,9 @@ public class pk_开奖_瓜分红包_押注人数相同测试_PkTest extends Duib
public void createPk(String bounsType,String endTime,String groupId) throws Exception { public void createPk(String bounsType,String endTime,String groupId) throws Exception {
Response betResponse = pkActivityService.betForSetUp(bounsType,endTime); Response betResponse = pkActivityService.betForSetUp(bounsType,endTime);
String betId = MatcherString.getString(betResponse.asString(),"\"data\": (\\w*)",1); betResponse.prettyPrint();
String betId = betResponse.jsonPath().getString("data");
// String betId = MatcherString.getString(betResponse.asString(),"\"data\": (\\w*)",1);
newBetId = betId; newBetId = betId;
logger.info("newBetId的信息为"+newBetId); logger.info("newBetId的信息为"+newBetId);
Response betRelation = pkActivityService.betGroupRelation(betId,endTime,groupId); Response betRelation = pkActivityService.betGroupRelation(betId,endTime,groupId);
......
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