Commit f56bcb89 authored by 吕雯燕's avatar 吕雯燕

lv

parent e4063a33
...@@ -33,13 +33,13 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -33,13 +33,13 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
@Autowired @Autowired
MobileService mobileService; MobileService mobileService;
// @Test(description = "1个Q币用户兑换限制永久1次") @Test(description = "1个Q币用户兑换限制永久1次")
public void Q币用户永久兑换限制测试() throws Exception{ public void Q币用户永久兑换限制测试() throws Exception{
int uid = 7280; int uid = 7262;
String actualCredits = "1"; String actualCredits = "1";
String degreeId = "1"; String degreeId = "1";
String appItemId = "195997"; String appItemId = "196922";
String credits = "1"; String credits = "1";
String qq = "806854056"; String qq = "806854056";
String message = ""; String message = "";
...@@ -51,7 +51,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -51,7 +51,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
logger.info("用户成功兑换一次"); logger.info("用户成功兑换一次");
//使用同一个qq号,再次兑换 //使用同一个qq号,再次兑换
Thread.sleep(3000); Thread.sleep(4000);
try{ try{
response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,qq); response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,qq);
response.prettyPrint(); response.prettyPrint();
...@@ -77,20 +77,20 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -77,20 +77,20 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}finally { }finally {
jdbc.update("DELETE FROM credits_dev.consumer_limit_record_only WHERE item_id = 2 and consumer_id = 100147134 "); jdbc.update("DELETE FROM credits_dev.consumer_limit_record_only WHERE item_id = 2 and consumer_id = 100152002 ");
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = 2 and consumer_id = 100147134 "); jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = 2 and consumer_id = 100152002 ");
} }
} }
// @Test(description = "2个Q币用户兑换限制每天1次") @Test(description = "2个Q币用户兑换限制每天1次")
public void Q币用户每天兑换限制测试() throws Exception{ public void Q币用户每天兑换限制测试() throws Exception{
int uid = 7281; int uid = 7263;
String actualCredits = "2"; String actualCredits = "2";
String degreeId = "2"; String degreeId = "2";
String appItemId = "195997"; String appItemId = "196922";
String credits = "2"; String credits = "2";
String qq = "806854056"; String qq = "806854056";
String message = ""; String message = "";
...@@ -102,7 +102,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -102,7 +102,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
logger.info("用户成功兑换一次"); logger.info("用户成功兑换一次");
//使用不同的QQ号,再次兑换 //使用不同的QQ号,再次兑换
Thread.sleep(3000); Thread.sleep(4000);
try{ try{
response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,"123456789"); response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,"123456789");
response.prettyPrint(); response.prettyPrint();
...@@ -138,7 +138,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -138,7 +138,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
logger.info("当前时间-1天:" + dateFormat.format(calendar.getTime())); logger.info("当前时间-1天:" + dateFormat.format(calendar.getTime()));
//更新表记录,修改记录为前一天 //更新表记录,修改记录为前一天
String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 2 and consumer_id = 100147136 ORDER BY id DESC LIMIT 1"; String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 2 and consumer_id = 100152003 ORDER BY id DESC LIMIT 1";
jdbc.update(sql); jdbc.update(sql);
...@@ -146,20 +146,19 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -146,20 +146,19 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
} }
// @Test(description = "3个Q币用户兑换限制每月1次") @Test(description = "3个Q币用户兑换限制每月1次")
public void Q币用户每月兑换限制测试() throws Exception{ public void Q币用户每月兑换限制测试() throws Exception{
int uid = 7282; int uid = 7264;
String actualCredits = "3"; String actualCredits = "3";
String degreeId = "3"; String degreeId = "3";
String appItemId = "195997"; String appItemId = "196922";
String credits = "3"; String credits = "3";
String qq = "806854056"; String qq = "806854056";
String message = ""; String message = "";
try{ try{
//支付宝兑换 //Qb兑换
Thread.sleep(3000);
Response response = this.Q币兑换(uid,actualCredits,degreeId,appItemId,credits,qq); Response response = this.Q币兑换(uid,actualCredits,degreeId,appItemId,credits,qq);
Assert.assertEquals(response.jsonPath().getString("data.payCreditsStatus"),"1","校验兑换失败"); Assert.assertEquals(response.jsonPath().getString("data.payCreditsStatus"),"1","校验兑换失败");
logger.info("用户成功兑换一次"); logger.info("用户成功兑换一次");
...@@ -167,7 +166,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -167,7 +166,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
//再次兑换 //再次兑换
Thread.sleep(3000); Thread.sleep(3000);
try{ try{
response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,qq); response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,"123456789");
response.prettyPrint(); response.prettyPrint();
}catch (Exception e){ }catch (Exception e){
...@@ -180,7 +179,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -180,7 +179,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
String btnText = MatcherString.getString(detailResponse.asString(), "\"3\":\\{\"btnText\":\"(.*?)\",", 1); String btnText = MatcherString.getString(detailResponse.asString(), "\"3\":\\{\"btnText\":\"(.*?)\",", 1);
logger.info("再次兑换按钮:" + btnText); logger.info("再次兑换按钮:" + btnText);
Assert.assertTrue(message.contains("\"desc\":\"抱歉,该QQ号已达到每月充值上限,请换一个QQ号吧。\""),"校验用户兑换限制失败"); Assert.assertTrue(message.contains("\"desc\":\"已兑完\""),"校验用户兑换限制失败");
Assert.assertEquals(btnText,"已兑换","校验马上兑换按钮状态失败"); Assert.assertEquals(btnText,"已兑换","校验马上兑换按钮状态失败");
logger.info("校验3个Q币用户每月兑换限制成功"); logger.info("校验3个Q币用户每月兑换限制成功");
...@@ -201,7 +200,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -201,7 +200,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
logger.info("当前时间-30天:" + dateFormat.format(calendar.getTime())); logger.info("当前时间-30天:" + dateFormat.format(calendar.getTime()));
//更新表记录,修改记录为前一个月 //更新表记录,修改记录为前一个月
String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 2 and consumer_id = 100147137 ORDER BY id DESC LIMIT 1"; String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 2 and consumer_id = 100152004 ORDER BY id DESC LIMIT 1";
jdbc.update(sql); jdbc.update(sql);
...@@ -209,18 +208,18 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -209,18 +208,18 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
} }
// @Test(description = "Q币会员等级限制LV5") @Test(description = "Q币会员等级限制LV5")
public void Q币会员等级测试() throws Exception{ public void Q币会员等级测试() throws Exception{
int uid = 7282; int uid = 7264;
String actualCredits = "4"; String actualCredits = "4";
String degreeId = "4"; String degreeId = "4";
String appItemId = "195997"; String appItemId = "196922";
String credits = "4"; String credits = "4";
String qq = "806854056"; String qq = "806854056";
String message = ""; String message = "";
//用户登录, vip=5 //用户登录, vip=5
Map cookies = authorization.generateSignAutoLogin("SvSQyVi2iLSoXgaRutJgK1UCkWb",7273); Map cookies = authorization.generateSignAutoLogin("3aWcuY9uqeV9Mzs8cuwttvWMtSNY",7265);
//会员符合条件,兑换 //会员符合条件,兑换
......
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