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

lv

parent 4c582f4e
......@@ -17,6 +17,7 @@ public class Database {
public static String orders13 = "orders_0717";
public static String orders14 = "orders_0712";
public static String orders15 = "orders_0718";
public static String orders16 = "orders_0721";
......
package http.cases.ExchangeTest.兑吧_直充类商品兑换;
import http.cases.ExchangeTest.CheckTemplet;
import http.cases.ExchangeTest.Database;
import http.service.Authorization;
import http.service.app.gawService;
import http.service.app.MobileService;
......@@ -164,7 +165,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
logger.info("用户成功兑换一次");
//再次兑换
Thread.sleep(3000);
Thread.sleep(4000);
try{
response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,"123456789");
response.prettyPrint();
......@@ -242,6 +243,86 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
@Test(description = "Q币档位篡改测试")
public void Q币档位篡改测试() throws Exception{
int uid = 7293;
String actualCredits = "3";
String degreeId = "100";
String appItemId = "196922";
String credits = "3";
String qq = "806854056";
String message = "";
//Q币兑换,档位参数不存在
try{
Response response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,qq);
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("校验Q币档位篡改无法兑换成功");
}
@Test(description = "Q币用户id篡改测试")
public void Q币用户id篡改测试() throws Exception{
//商品: lv测试应用77
//uid1: 大富翁app
//uid2: lv测试应用88
int uid1 = 7084;
int uid2 = 7292;
String actualCredits = "3";
String degreeId = "3";
String appItemId = "196922";
String credits = "3";
String qq = "806854056";
String message = "";
//话费兑换, 大富翁app已上架Q币
Response response = gawService.qbExchange(uid1,actualCredits,degreeId,appItemId,credits,qq);
response.prettyPrint();
String orderId = response.jsonPath().getString("data.orderId");
//查询数据库
Thread.sleep(3000);
Map<String,Object> mapOrderId = jdbc.findSimpleResult("SELECT * FROM "+ Database.orders_consumer+"."+ Database.orders16 + " where id = " + orderId);
String orderStatus = String.valueOf(mapOrderId.get("status"));
String orderappId = String.valueOf(mapOrderId.get("app_id"));
String orderCredits = String.valueOf(mapOrderId.get("credits"));
logger.info("订单积分:" + orderCredits);
Assert.assertEquals(orderStatus,"consume_success","校验status失败");
Assert.assertEquals(orderappId,"1","校验appId失败");
Assert.assertEquals(orderCredits,"300","校验credits失败");
logger.info("校验Q币用户id1篡改兑换成功");
//Q币兑换,lv测试应用88app未上架Q币
try{
Response response2 = gawService.qbExchange(uid2,actualCredits,degreeId,appItemId,credits,qq);
response2.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("校验Q币用户id2篡改无法兑换成功");
}
public Response Q币兑换(int uid, String actualCredits, String degreeId, String appItemId, String credits, String qq) throws Exception {
Response response = gawService.qbExchange(uid,actualCredits,degreeId,appItemId,credits,qq);
......
......@@ -269,7 +269,7 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
@Test(description = "话费用户id改测试")
@Test(description = "话费用户id改测试")
public void 话费用户id篡改测试() throws Exception{
//商品: lv测试应用77
......
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