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

lv

parent fc46d50f
......@@ -576,5 +576,59 @@ public class 自有新优惠券_兑换限制测试_ExchangeTest extends CheckTem
@Test(description = "新优惠券用户id篡改测试")
public void 优惠券用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 6999;
String appItemId = "197048";
String message = "";
//优惠券兑换
try{
Response response = gawService.couponExchange(uid,appItemId,175);
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 = 7028;
String appItemId = "197048";
String message = "";
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.couponExchange(uid,appItemId,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篡改无法兑换成功");
}
}
......@@ -480,6 +480,58 @@ public class 自有新卡密_兑换限制测试_ExchangeTest extends CheckTemple
@Test(description = "卡密用户id篡改测试")
public void 卡密用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 6997;
String appItemId = "197049";
String message = "";
//卡密兑换
try{
Response response = gawService.couponExchange(uid,appItemId,176);
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 = 7294;
String appItemId = "197049";
String message = "";
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.couponExchange(uid,appItemId,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篡改无法兑换成功");
}
}
......@@ -407,7 +407,7 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
@Test(description = "新自有实物用户id修改测试")
@Test(description = "新实物用户id篡改测试")
public void 实物用户id篡改测试() throws Exception{
//uid: 大富翁app
......@@ -435,7 +435,7 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
}
@Test(description = "新自有实物积分修改测试")
@Test(description = "新实物积分修改测试")
public void 实物积分篡改测试() throws Exception{
int uid = 7288;
......@@ -462,6 +462,34 @@ public class 自有新实物_兑换流程测试_ExchangeTest extends CheckTemple
}
@Test(description = "新实物skuId篡改测试")
public void 实物skuId篡改测试() throws Exception{
int uid = 7288;
String appItemId = "197042";
String itemId = null ;
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//实物兑换,skuId改为其它商品的
try{
Response response = gawService.objectExchange(cookies,appItemId,itemId,"36");
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篡改无法兑换成功");
}
//测试使用
......
......@@ -443,4 +443,61 @@ public class 自有新虚拟商品_充值_兑换限制_ExchangeTest extends Chec
}
@Test(description = "新虚拟商品用户id篡改测试")
public void 虚拟商品用户id篡改测试() throws Exception{
//uid: 大富翁app
//商品: lv测试应用55
int uid = 6970;
String appItemId = "197050";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//虚拟商品兑换
try{
Response response = gawService.virtualExchange(cookies, appItemId,177);
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 = 7295;
String appItemId = "197050";
String message = "";
Map cookies = authorization.dafuwengLogin(uid);
//优惠券兑换,skuId改为其它商品的
try{
Response response = gawService.virtualExchange(cookies, appItemId,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篡改无法兑换成功");
}
}
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