Commit 34afb6f0 authored by 吕雯燕's avatar 吕雯燕

lv

parent e58c9c8b
......@@ -498,5 +498,58 @@ public class 兑吧新优惠券_兑换流程测试_ExchangeTest extends CheckTem
@Test(description = "新优惠券用户id篡改测试")
public void 优惠券用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 10;
String appItemId = "197044";
String itemId = "32656";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//优惠券兑换
try{
Response response = gawService.couponExchange(cookies,appItemId,itemId,"172");
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{
int uid = 7289;
String appItemId = "197044";
String itemId = "32656" ;
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.couponExchange(cookies,appItemId,itemId,"105");
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篡改无法兑换成功");
}
}
......@@ -495,9 +495,9 @@ public class 兑吧新实物_兑换流程测试_ExchangeTest extends CheckTemple
}
logger.info(message);
Assert.assertTrue(message.contains("\"desc\":\"无权访问\""),"校验message失败");
Assert.assertTrue(message.contains("\"desc\":\"商品不存在\""),"校验message失败");
Assert.assertTrue(message.contains("\"success\":false"),"校验success失败");
logger.info("校验实物用户id篡改无法兑换成功");
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