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

Merge branch 'duiba_wenyan'

parents 2e2bc59a 06b1bdcd
...@@ -107,40 +107,32 @@ public class 兑吧老实物_兑换流程测试_ExchangeTest extends CheckTemple ...@@ -107,40 +107,32 @@ public class 兑吧老实物_兑换流程测试_ExchangeTest extends CheckTemple
return result; return result;
} }
//实物兑换积分不足 //实物兑换积分不足实物兑换积分不足
@Test(description = "实物兑换积分不足") @Test(description = "实物兑换积分不足")
public void 积分不足() throws Exception { public void 积分不足() throws Exception {
String message = "";
//活动详情页 //活动详情页
Response response = mobileService.detail(authorization.dafuwengLogin(3086), "28515"); Response response = mobileService.detail(authorization.dafuwengLogin(3086), "28515");
Map<String, String> map = authorization.dafuwengLogin(3086); Map<String, String> map = authorization.dafuwengLogin(3086);
Assert.assertEquals(String.valueOf(response.getStatusCode()), "200", "活动详情页请求异常"); Assert.assertEquals(String.valueOf(response.getStatusCode()), "200", "活动详情页请求异常");
//实物兑换 //实物兑换
//无法兑换,直接抛出
try{
response = couponExchangeService.objectExchange(map, "167141", "28515", "null", "yrJRr7Cddp2YeQd", "null"); response = couponExchangeService.objectExchange(map, "167141", "28515", "null", "yrJRr7Cddp2YeQd", "null");
response.prettyPrint(); response.prettyPrint();
//校验兑换成功
// Assert.assertEquals(response.jsonPath().getString("success"),"true"); }catch (Exception e){
//获取orderId message = e.toString();
String orderId = response.jsonPath().getString("orderId");
//获取兑换结果
response = mobileService.orderAmbStatusQuery(3086,orderId);
response.prettyPrint();
String message = response.jsonPath().getString("data.message");
int i = 10;
//异步接口,直到兑换成功
while (i > 0 && "兑换正在处理中...".equals(message)) {
Thread.sleep(1000);
response = mobileService.orderAmbStatusQuery(3086,orderId);
response.prettyPrint();
message = response.jsonPath().getString("data.message");
i--;
} }
logger.info(message);
//校验messaga字段返回值 //校验messaga字段返回值
String message2 = response.jsonPath().getString("data.message"); Assert.assertTrue(message.contains("\"success\":false"),"校验message失败");
Assert.assertEquals(message2,"兑换失败,用户积分余额不足","message字段校验失败-期望是积分不足"); Assert.assertTrue(message.contains("\"message\":\"您的积分不足\""),"校验message失败"); //这个提示很奇怪
logger.info("校验实物兑换积分不足成功");
// authorization.dafuwengLogin(2720,true);
} }
//实物兑换限制消费 //实物兑换限制消费
......
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