Commit 4cbcbdcb authored by 钱雯君's avatar 钱雯君

add

parent 54707487
...@@ -124,6 +124,44 @@ public class pk_管理端测试_AccessTest extends DuibaTestBase { ...@@ -124,6 +124,44 @@ public class pk_管理端测试_AccessTest extends DuibaTestBase {
} }
@Test
public void 创建pk活动_瓜分优惠券测试() {
try {
Response oldBetList = pkActivityService.getMngBetList();
String oldTotal = oldBetList.jsonPath().getString("data.params.total");
logger.info("创建之前的列表中条数为:"+oldTotal);
createPk("3");
Response newBetList = pkActivityService.getMngBetList();
String newTotal = newBetList.jsonPath().getString("data.params.total");
logger.info("创建之前的列表中条数为:"+oldTotal+"创建之后的列表中条数为:"+newTotal);
Assert.assertEquals(String.valueOf(Long.valueOf(newTotal)-1L),oldTotal,"新建之后列表获取数据校验失败");
List<BetMngVo> betList = newBetList.jsonPath().getList("data.page",BetMngVo.class);
logger.info("betIds"+JSON.toJSONString(betIds));
for (BetMngVo bet:betList){
if (bet.getId().equals(betIds.get("3"))){
logger.info("bet的信息为="+JSON.toJSONString(bet));
Assert.assertEquals(bet.getBetType(),"1","校验pk活动单选单次类型失败");
Assert.assertEquals(bet.getBonusType(),"3","校验pk活动瓜分类型失败");
Assert.assertEquals(bet.getBonusAmount(),"0.00","校验pk活动瓜分类型失败");
Assert.assertEquals(bet.getTitle(),"【自动化】新建pk活动-瓜分优惠券","校验pk活动名称失败");
Assert.assertEquals(bet.getConfigStatus(),"3","校验pk活动状态失败");
Assert.assertEquals(bet.getEndTime(),"2021-12-31 23:55","校验pk活动结束时间失败");
Assert.assertEquals(bet.getPluginId(),"12","校验插件id失败");
Assert.assertEquals(bet.getPrizeLimit(),"1000","校验奖品发放上限失败");
}else{
break;
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Test @Test
public void 创建pk活动组_无投放渠道(){ public void 创建pk活动组_无投放渠道(){
...@@ -211,8 +249,8 @@ public class pk_管理端测试_AccessTest extends DuibaTestBase { ...@@ -211,8 +249,8 @@ public class pk_管理端测试_AccessTest extends DuibaTestBase {
public void tearDown() { public void tearDown() {
try { try {
Boolean result = jdbc.update("delete from act_com_conf.tb_bet_group_relation where bet_id in (select id from act_com_conf.tb_bet_config where title = \"【自动化】新建pk活动-瓜分经验\" OR title = \"【自动化】新建pk活动-瓜分红包\")\n"); Boolean result = jdbc.update("delete from act_com_conf.tb_bet_group_relation where bet_id in (select id from act_com_conf.tb_bet_config where title = \"【自动化】新建pk活动-瓜分经验\" OR title = \"【自动化】新建pk活动-瓜分红包\" OR title = \"【自动化】新建pk活动-瓜分红包\")\n");
Boolean result1 = jdbc.update("delete from act_com_conf.tb_bet_config where title = \"【自动化】新建pk活动-瓜分经验\" OR title = \"【自动化】新建pk活动-瓜分红包\"\n"); Boolean result1 = jdbc.update("delete from act_com_conf.tb_bet_config where title = \"【自动化】新建pk活动-瓜分经验\" OR title = \"【自动化】新建pk活动-瓜分红包\" OR title = \"【自动化】新建pk活动-瓜分优惠券\"\n");
Boolean result2 = jdbc.update("delete from act_com_conf.tb_app_group_relation where group_id in (select id from act_com_conf.tb_bet_act_group where title = '【勿动】新增pk组')"); Boolean result2 = jdbc.update("delete from act_com_conf.tb_app_group_relation where group_id in (select id from act_com_conf.tb_bet_act_group where title = '【勿动】新增pk组')");
Boolean result3 = jdbc.update("delete from act_com_conf.tb_bet_act_group where title = '【勿动】新增pk组'"); Boolean result3 = jdbc.update("delete from act_com_conf.tb_bet_act_group where title = '【勿动】新增pk组'");
......
...@@ -62,12 +62,18 @@ public class PkActivityService { ...@@ -62,12 +62,18 @@ public class PkActivityService {
Map<String,Object> para = new HashMap<>(); Map<String,Object> para = new HashMap<>();
para.put("betOptionDtoList",betOptionVoList); para.put("betOptionDtoList",betOptionVoList);
para.put("betType","1");//1-单选单次; para.put("betType","1");//1-单选单次;
para.put("bonusType",bonusType);//1-经验;2-红包 para.put("bonusType",bonusType);//1-经验;2-红包;3-优惠券
if (bonusType.equals("2")){ if (bonusType.equals("2")){
para.put("bonusAmount","0.1");//实际瓜分红包金额 para.put("bonusAmount","0.1");//实际瓜分红包金额
para.put("title","【自动化】新建pk活动-瓜分红包"); para.put("title","【自动化】新建pk活动-瓜分红包");
}else { }else if (bonusType.equals("1")){
para.put("title","【自动化】新建pk活动-瓜分经验"); para.put("title","【自动化】新建pk活动-瓜分经验");
}else {
para.put("title","【自动化】新建pk活动-瓜分优惠券");
para.put("bonusAmount","");
para.put("pluginId","12");//插件id
para.put("prizeLimit","1000");//发放上限
} }
para.put("configStatus","1"); para.put("configStatus","1");
para.put("creditsValue","1"); para.put("creditsValue","1");
......
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