Commit 4921d33c authored by 钱雯君's avatar 钱雯君

add

parent 4de4f50e
......@@ -168,7 +168,7 @@ public class 集卡_出奖方式测试_DuibaTest extends DuibaTestBase {
String orderId = openResponse.jsonPath().getString("orderId");
Response statusResponse = newActivityService.getOrderStatus31(orderId,uid);
// logger.info("开奖结果如下1:");
// statusResponse.prettyPrint();
statusResponse.prettyPrint();
String playResult = String.valueOf(statusResponse.jsonPath().getString("result"));
int i = 8;
while (i > 0 && (playResult.equals("0"))) {
......@@ -177,7 +177,7 @@ public class 集卡_出奖方式测试_DuibaTest extends DuibaTestBase {
playResult = String.valueOf(statusResponse.jsonPath().getString("result"));
i--;
// logger.info("开奖结果如下2:");
// statusResponse.prettyPrint();
statusResponse.prettyPrint();
}
return statusResponse;
......
......@@ -10,6 +10,7 @@ package http.cases.PkTest;
import base.DuibaLog;
import base.DuibaTestBase;
import com.alibaba.fastjson.JSONObject;
import http.model.BetMobileVo;
import http.service.Activity.PkService;
import http.service.Manager.PkActivityService;
......@@ -17,6 +18,8 @@ import io.restassured.response.Response;
import org.joda.time.format.DateTimeFormat;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import utils.MatcherString;
......@@ -57,7 +60,7 @@ public class pk_开奖_瓜分红包测试 extends DuibaTestBase {
private List<String> optionsIds = new ArrayList<>();
@BeforeMethod
// @BeforeMethod
public void setUp() {
try {
......@@ -72,28 +75,32 @@ public class pk_开奖_瓜分红包测试 extends DuibaTestBase {
@Test
public void 瓜分红包_两个选项_押注人数相同_开奖测试() throws Exception{
Response betList = pkService.getBetList(3445);
List<BetMobileVo> betMobileVoList = betList.jsonPath().getList("data.unbetList",BetMobileVo.class);
for (BetMobileVo bet:betMobileVoList){
if (bet.getBetConfig().getId().equals(newBetId)){
for (int i=0;i<bet.getOptions().size();i++){
optionsIds.add(bet.getOptions().get(i).getOptionId());
}
}
}
// Response betList = pkService.getBetList(3445);
// List<BetMobileVo> betMobileVoList = betList.jsonPath().getList("data.unbetList",BetMobileVo.class);
// for (BetMobileVo bet:betMobileVoList){
// if (bet.getBetConfig().getId().equals(newBetId)){
// for (int i=0;i<bet.getOptions().size();i++){
// optionsIds.add(bet.getOptions().get(i).getOptionId());
// }
// }
// }
// logger.info("pk活动id为:"+newBetId+",选项id为:"+ optionsIds.toString());
//押注第一个选项:user01,user02
//押注第二个选项:user03,user04
Response res1 = pkService.doJoin(user01,newBetId,optionsIds.get(0));
Response res2 = pkService.doJoin(user02,newBetId,optionsIds.get(0));
Response res3 = pkService.doJoin(user03,newBetId,optionsIds.get(1));
Response res4 = pkService.doJoin(user04,newBetId,optionsIds.get(1));
// Response res1 = pkService.doJoin(user01,newBetId,optionsIds.get(0));
// Response res2 = pkService.doJoin(user02,newBetId,optionsIds.get(0));
// Response res3 = pkService.doJoin(user03,newBetId,optionsIds.get(1));
// Response res4 = pkService.doJoin(user04,newBetId,optionsIds.get(1));
Response res1 = pkService.doJoin(user01,"1124","2247");
// res1.prettyPrint();
//修改开奖时间
this.modifyOpenPrizeTime();
// this.modifyOpenPrizeTime();
int i=8;
// int i=8;
......@@ -126,14 +133,30 @@ public class pk_开奖_瓜分红包测试 extends DuibaTestBase {
return endTimeStr;
}
public static void main(String[] args) {
DateTime time1 = DateTime.now();
DateTime time2 = time1.plusMinutes(1);
DateTimeFormatter format = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
logger.info("\ntime1="+ format.print(time1.getMillis())+"\ntime2="+ format.print(time2.getMillis()));
// public static void main(String[] args) {
// DateTime time1 = DateTime.now();
// DateTime time2 = time1.plusMinutes(1);
//
// DateTimeFormatter format = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
// logger.info("\ntime1="+ format.print(time1.getMillis())+"\ntime2="+ format.print(time2.getMillis()));
//
// logger.info("\nendTimeStr="+format.print(time1.getMillis()).toString());
//
// }
@AfterMethod
public void tearDown(){
try {
// if (!newBetId.equals("")){
// Boolean res1 = jdbc.update("delete from act_com_conf.tb_bet_config where id = ?\n",newBetId);
// Boolean res2 = jdbc.update("delete from act_com_conf.tb_bet_group_relation where bet_id = ?\n",newBetId);
// }
logger.info("\nendTimeStr="+format.print(time1.getMillis()).toString());
Boolean res3 = 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活动-瓜分红包\")\n");
Boolean res4 = jdbc.update("delete from act_com_conf.tb_bet_config where title = \"【自动化】新建pk活动-瓜分红包\"\n");
}catch (Exception e){
e.printStackTrace();
}
}
}
\ No newline at end of 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