Commit 07f85860 authored by 吕雯燕's avatar 吕雯燕

lv

parent bcd10a17
......@@ -39,14 +39,14 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
MobileService mobileService;
// @Test(description = "1元支付宝用户兑换限制永久1次")
@Test(description = "1元支付宝用户兑换限制永久1次")
public void 支付宝用户永久兑换限制测试() throws Exception{
int uid = 7262;
String actualCredits = "100";
int uid = 7269;
String actualCredits = "1";
String degreeId = "1";
String appItemId = "195996";
String credits = "100";
String appItemId = "196921";
String credits = "1";
String message = "";
try{
......@@ -82,21 +82,21 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}finally {
jdbc.update("DELETE FROM credits_dev.consumer_limit_record_only WHERE item_id = 55 AND consumer_id = 100147103");
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = 55 AND consumer_id = 100147103");
jdbc.update("DELETE FROM credits_dev.consumer_limit_record_only WHERE item_id = 55 AND consumer_id = 100152009");
jdbc.update("DELETE FROM credits_dev.consumer_limit_record WHERE item_id = 55 AND consumer_id = 100152009");
}
}
// @Test(description = "2元支付宝用户兑换限制每天1次")
@Test(description = "2元支付宝用户兑换限制每天1次")
public void 支付宝用户每天兑换限制测试() throws Exception{
int uid = 7270;
String actualCredits = "200";
String actualCredits = "2";
String degreeId = "2";
String appItemId = "195996";
String credits = "200";
String appItemId = "196921";
String credits = "2";
String message = "";
try{
......@@ -142,7 +142,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
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 = 55 and consumer_id = 100147117 ORDER BY id DESC LIMIT 1";
String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 55 and consumer_id = 100152010 ORDER BY id DESC LIMIT 1";
jdbc.update(sql);
......@@ -150,14 +150,14 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
// @Test(description = "3元支付宝用户兑换限制每月1次")
@Test(description = "3元支付宝用户兑换限制每月1次")
public void 支付宝用户每月兑换限制测试() throws Exception{
int uid = 7271;
String actualCredits = "300";
String actualCredits = "3";
String degreeId = "3";
String appItemId = "195996";
String credits = "300";
String appItemId = "196921";
String credits = "3";
String message = "";
try{
......@@ -203,7 +203,7 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
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 = 55 and consumer_id = 100147118 ORDER BY id DESC LIMIT 1";
String sql = "UPDATE credits_dev.consumer_limit_record SET gmt_create = '" + dateFormat.format(calendar.getTime()) +"' WHERE item_id = 55 and consumer_id = 100152011 ORDER BY id DESC LIMIT 1";
jdbc.update(sql);
......@@ -211,21 +211,20 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
// @Test(description = "支付宝会员等级限制LV5")
@Test(description = "支付宝会员等级限制LV5")
public void 支付宝会员等级测试() throws Exception{
int uid = 7271;
String actualCredits = "4";
String degreeId = "4";
String appItemId = "195996";
String appItemId = "196921";
String credits = "4";
String message = "";
Map cookies = authorization.generateSignAutoLogin("SvSQyVi2iLSoXgaRutJgK1UCkWb",7273);
Map cookies = authorization.generateSignAutoLogin("3aWcuY9uqeV9Mzs8cuwttvWMtSNY",7265);
//会员符合条件,兑换
Response response = this.支付宝兑换(7271,actualCredits,degreeId,appItemId,credits);
Response response = this.支付宝兑换(uid,actualCredits,degreeId,appItemId,credits);
Assert.assertEquals(response.jsonPath().getString("data.payCreditsStatus"),"1","校验兑换失败");
logger.info("用户等级LV0成功兑换一次");
......@@ -244,6 +243,34 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "支付宝")
public void 支付宝档位限制测试() throws Exception{
int uid = 7271;
String actualCredits = "4";
String degreeId = "10";
String appItemId = "196921";
String credits = "4";
String message = "";
//支付宝兑换,档位参数不存在
try{
Response response = gawService.alipayExchange(uid,actualCredits,degreeId,appItemId,credits);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"success\":false"),"校验message失败");
Assert.assertTrue(message.contains("\"desc\":\"档位不存在\""),"校验message失败");
logger.info("校验支付宝档位限制成功");
}
public Response 支付宝兑换(int uid, String actualCredits, String degreeId, String appItemId,String credits) throws Exception {
Response response = gawService.alipayExchange(uid, actualCredits, degreeId, appItemId, credits);
......
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