Commit 51b2e4d8 authored by 吕雯燕's avatar 吕雯燕

lv

parent 34afb6f0
...@@ -506,6 +506,64 @@ public class 兑吧卡密_兑换流程测试_ExchangeTest extends CheckTemplet { ...@@ -506,6 +506,64 @@ public class 兑吧卡密_兑换流程测试_ExchangeTest extends CheckTemplet {
} }
@Test(description = "兑吧卡密用户id篡改测试")
public void 卡密用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 11;
String appItemId = "197045";
String itemId = "32657";
String skuId = "173";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//卡密兑换
try{
Response response = gawService.couponExchange(cookies,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"无权访问\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验卡密用户id篡改无法兑换成功");
}
@Test(description = "兑吧卡密skuId篡改测试")
public void 卡密skuId篡改测试() throws Exception{
String appItemId = "197045";
String itemId = "32657";
String skuId = "106";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.couponExchange(cookies,appItemId,itemId,skuId);
response.prettyPrint();
}catch (Exception e){
message = e.toString();
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"商品不存在\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验卡密skuId篡改无法兑换成功");
}
} }
...@@ -552,4 +552,8 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem ...@@ -552,4 +552,8 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
logger.info("校验优惠券skuId篡改无法兑换成功"); logger.info("校验优惠券skuId篡改无法兑换成功");
} }
} }
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