Commit c39e4608 authored by qwj-github's avatar qwj-github

add

parent 9189839d
......@@ -38,7 +38,7 @@ import java.util.Map;
* @create 2018/8/9
* @since 1.0.0
*/
public class pk_开奖_瓜分优惠券_PkTest extends DuibaTestBase {
public class pk_瓜分优惠券_PkTest extends DuibaTestBase {
@Autowired
PkService pkService;
......@@ -50,14 +50,14 @@ public class pk_开奖_瓜分优惠券_PkTest extends DuibaTestBase {
private static DuibaLog logger = DuibaLog.getLogger();
private String groupId = "7";
private String groupId = "147";
private Integer user01 = 4907;//appid=18816
private String consumerId01 = "100109082";//activity_order_con.tb_trade_center_activity_order_0794
private Integer user02 = 4908;//appid=18816
private String consumerId02 = "100109083";//activity_order_con.tb_trade_center_activity_order_0795
private Integer user03 = 4909;//appid=2239
private String consumerId03 = "100109084";//activity_order_con.tb_trade_center_activity_order_0796
private Integer user01 = 5197;//appid=18816
private String consumerId01 = "100114055";//activity_order_con.tb_trade_center_activity_order_0794
private Integer user02 = 5198;//appid=18816
private String consumerId02 = "100114056";//activity_order_con.tb_trade_center_activity_order_0795
private Integer user03 = 5199;//appid=2239
private String consumerId03 = "100114057";//activity_order_con.tb_trade_center_activity_order_0796
List<String> wins = new ArrayList<>();
List<String> loses = new ArrayList<>();
......@@ -132,7 +132,7 @@ public class pk_开奖_瓜分优惠券_PkTest extends DuibaTestBase {
//校验点
//1、pk活动表配置的状态更新为4;2、订单表的addCredits字段为瓜分的红包值;3、先押注 的选项为胜方,胜负的额押注人数>负方的押注人数,4、校验account表的红包值加上去
checkPKConfig();
checkPKResult("18816");
checkPKResult("21835");
checkUserOrder(wins,loses);
checkRecord(wins,loses);
......
......@@ -23,9 +23,11 @@ import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import utils.GetDbName;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -37,7 +39,7 @@ import java.util.Map;
* @create 2018/8/9
* @since 1.0.0
*/
public class pk_开奖_瓜分红包_投放两个app_PkTest extends DuibaTestBase {
public class pk_瓜分红包_投放两个app_PkTest extends DuibaTestBase {
@Autowired
PkService pkService;
......@@ -47,16 +49,17 @@ public class pk_开奖_瓜分红包_投放两个app_PkTest extends DuibaTestBase
private static DuibaLog logger = DuibaLog.getLogger();
private String groupId = "6,7";
//146-pk测试3,pk测试4
private String groupId = "146";
private Integer user01 = 4812;//appid=18816
private String consumerId01 = "100108112";//activity_order_con.tb_trade_center_activity_order_0848
private Integer user02 = 4813;//appid=18816
private String consumerId02 = "100108113";//activity_order_con.tb_trade_center_activity_order_0849
private Integer user03 = 4814;//appid=2239
private String consumerId03 = "100108114";//activity_order_con.tb_trade_center_activity_order_0850
private Integer user04 = 4815;//appid=2239
private String consumerId04 = "100108115";//activity_order_con.tb_trade_center_activity_order_0851
private Integer user01 = 5193;//appid=21833
private String consumerId01 = "100114050";//activity_order_con.tb_trade_center_activity_order_0848
private Integer user02 = 5194;//appid=21833
private String consumerId02 = "100114051";//activity_order_con.tb_trade_center_activity_order_0849
private Integer user03 = 5195;//appid=21834
private String consumerId03 = "100114052";//activity_order_con.tb_trade_center_activity_order_0850
private Integer user04 = 5196;//appid=21834
private String consumerId04 = "100114053";//activity_order_con.tb_trade_center_activity_order_0851
List<String> wins = new ArrayList<>();
List<String> loses = new ArrayList<>();
......@@ -90,13 +93,13 @@ public class pk_开奖_瓜分红包_投放两个app_PkTest extends DuibaTestBase
optionsIds.add(pks.get(i).get("id").toString());
}
logger.info("pk活动id为:"+newBetId+",选项id为:"+ optionsIds.toString());
Map<String,Object> user01_account1 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0848 where consumer_id = '100108112' and account_type = '6'\n");
Map<String,Object> user01_account1 = this.accountInfo(consumerId01);
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_0849 where consumer_id = '100108113' and account_type = '6'\n");
Map<String,Object> user02_account1 = this.accountInfo(consumerId02);
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_0850 where consumer_id = '100108114' and account_type = '6'\n");
Map<String,Object> user03_account1 = this.accountInfo(consumerId03);
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_0851 where consumer_id = '100108115' and account_type = '6'\n");
Map<String,Object> user04_account1 = this.accountInfo(consumerId04);
Long use4_Acc1 = Long.valueOf(user04_account1.get("balance_amount").toString());
......@@ -123,21 +126,21 @@ public class pk_开奖_瓜分红包_投放两个app_PkTest extends DuibaTestBase
//校验点
//1、pk活动表配置的状态更新为4;2、订单表的addCredits字段为瓜分的红包值;3、先押注 的选项为胜方,胜负的额押注人数>负方的押注人数,4、校验account表的红包值加上去
checkPKConfig();
checkPKResult("18816");
checkPKResult("2239");
checkPKResult("21833");
checkPKResult("21834");
checkUserOrder(wins,loses);
checkRecord(wins,loses);
Map<String,Object> user01_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0848 where consumer_id = '100108112' and account_type = '6'\n");
Map<String,Object> user01_account2 = this.accountInfo(consumerId01);
Long use1_Acc2 = Long.valueOf(user01_account2.get("balance_amount").toString());
Assert.assertEquals(use1_Acc2.toString(),String.valueOf(use1_Acc1+10),"用户1入账校验失败");
Map<String,Object> user02_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0849 where consumer_id = '100108113' and account_type = '6'\n");
Map<String,Object> user02_account2 = this.accountInfo(consumerId02);
Long use2_Acc2 = Long.valueOf(user02_account2.get("balance_amount").toString());
Assert.assertEquals(use2_Acc2,use2_Acc1,"用户2入账校验失败");
Map<String,Object> user03_account2 = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0850 where consumer_id = '100108114' and account_type = '6'\n");
Map<String,Object> user03_account2 = this.accountInfo(consumerId03);
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_0851 where consumer_id = '100108115' and account_type = '6'\n");
Map<String,Object> user04_account2 = this.accountInfo(consumerId04);
Long use4_Acc2 = Long.valueOf(user04_account2.get("balance_amount").toString());
Assert.assertEquals(use4_Acc2,use4_Acc1,"用户4入账校验失败");
......@@ -145,6 +148,25 @@ public class pk_开奖_瓜分红包_投放两个app_PkTest extends DuibaTestBase
}
public Map<String,Object> accountInfo(String consumerId) throws Exception{
Map<String,Object> map = new HashMap<>();
String dbName1 = GetDbName.getDbName("consumer_accounts.tb_consumer_account_",consumerId,"1");
String sql1 = "select * from "+dbName1+" where consumer_id = ? and account_type = '6'";
map = jdbc.findSimpleResult(sql1,consumerId);
return map;
}
public Map<String,Object> orderInfo(String consumerId,String betId) throws Exception{
Map<String,Object> map = new HashMap<>();
String dbName1 = GetDbName.getDbName("activity_order_con.tb_trade_center_activity_order_",consumerId,"1");
String sql1 = "select * from "+dbName1+" where consumer_id = ? and duiba_activity_id = ?\n";
map = jdbc.findSimpleResult(sql1,consumerId,betId);
return map;
}
public void createPk(String bounsType,String endTime,String groupId) throws Exception {
Response betResponse = pkActivityService.betForSetUp(bounsType,endTime);
......
......@@ -47,7 +47,7 @@ public class pk_管理端测试_PkTest extends DuibaTestBase {
private String endTime = "2021-12-31 23:55:00";
private Map<String,Object> betIds = new HashMap<>();
private String groupId = "5";
private String groupId = "147";
......
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