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

lv

parent 62d18de2
......@@ -179,4 +179,48 @@ public class 实物_兑换异常测试_ExchangeTest extends CheckTemplet {
}
//@Test
public void 每日支出上限测试() throws Exception{
int uid = 6550;
//第一次兑换
Response response = couponExchangeService.objectExchange(authorization.dafuwengLogin(uid), "191769", "32368", "null", "1w8i52", "null");
response.prettyPrint();
String orderId = response.jsonPath().getString("orderId");
//获取兑换结果
response = mobileService.orderAmbStatusQuery(uid,orderId);
response.prettyPrint();
String message = response.jsonPath().getString("data.message");
int i = 10;
//异步接口,直到兑换成功
while (i > 0 && "兑换正在处理中...".equals(message)) {
Thread.sleep(1000);
response = mobileService.orderAmbStatusQuery(uid,orderId);
response.prettyPrint();
message = response.jsonPath().getString("data.message");
i--;
}
//第二次兑换
try{
response = couponExchangeService.objectExchange(authorization.dafuwengLogin(uid), "178879", "31049", "null", "z9sydmcs", "null");
response.prettyPrint();
}catch (Exception e){
// message = e.toString();
}
// logger.info(message);
// Assert.assertTrue(message.contains("已兑完"));
// Assert.assertTrue(message.contains("\"success\":false"));
}
}
......@@ -23,6 +23,7 @@ public class CouponExchangeService {
@Autowired
Authorization authorization;
//实物兑换接口
public Response objectExchange(Map cookies,String appItemId,String itemId,String dba,String token,String validate) throws Exception {
Map<String,String> map = new HashMap<>();
map.put("appItemId",appItemId);
......
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