Commit 7ecd2884 authored by 赵然's avatar 赵然

zr

parent c4a65b3d
......@@ -324,6 +324,66 @@ public class 开发者账户余额校验测试_ExchangeTest extends DuibaTestBas
}
@Test
public void 支付宝审核通过测试() throws Exception{
int uid = 3771;
//查询兑换前的开发者账户余额
// Response accountResponse = developerAccountService.accountInfo();
// String remainMoney = accountResponse.jsonPath().getString("data.remainMoney");
// logger.info("兑换前的开发者账户余额:" + remainMoney);
// String remainMoneyNew =String.valueOf(Integer.valueOf(remainMoney) - 1020) ;
//支付宝兑换
String orderId = this.支付宝兑换订单(uid,"peeulk6392@sandbox.com","沙箱环境","10");
logger.info("订单号:" + orderId);
//订单审核,判断是否在待审核节点
Map<String,Object> mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders7+" WHERE id = " + orderId);
String flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
logger.info("数据库订单节点:" + flowWork);
String orderIdmain = String.valueOf(mapOrder.get("order_num"));
logger.info("兑吧订单号为:" + orderIdmain);
int i =10;
while (i > 0 && !flowWork.equals("Audit-started")) {
Thread.sleep(300);
mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders7+" WHERE id = " + orderId);
flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
logger.info("数据库订单节点:" + flowWork);
i--;
}
Response auditResponse = dsOrderService.submitAudit(orderId,"pass");
auditResponse.prettyPrint();
//判断订单是否审核成功,如果订单没有成功则继续审核
int j =10;
while (j > 0 && !flowWork.equals("Success-complete")) {
Thread.sleep(1000);
auditResponse = dsOrderService.submitAudit(orderId,"pass");
mapOrder = jdbc.findSimpleResult("SELECT * FROM "+Database.orders_consumer+"."+Database.orders7+" WHERE id = " + orderId);
flowWork = String.valueOf(mapOrder.get("flowwork_stage"));
logger.info("数据库订单节点:" + flowWork);
j--;
}
String status = String.valueOf(mapOrder.get("status"));
//兑换后的开发者账户余额
// accountResponse = developerAccountService.accountInfo();
// remainMoney = accountResponse.jsonPath().getString("data.remainMoney");
// logger.info("兑换后的开发者账户余额:" + remainMoney);
//校验开发者账户余额变动
Response accountResponse = developerAccountService.cashDetail(orderIdmain);
String remainMoney = String.valueOf(Integer.valueOf(accountResponse.jsonPath().getString("data.list[0].balance"))+Integer.valueOf(accountResponse.jsonPath().getString("data.list[0].moneyChange")));
logger.info("兑换前的开发者账户余额:" + remainMoney);
remainMoney =String.valueOf(Integer.valueOf(remainMoney) - 1020) ;
String remainMoneyNew = accountResponse.jsonPath().getString("data.list[0].balance");
logger.info("兑换后的开发者账户余额:" + remainMoneyNew);
Assert.assertEquals(remainMoneyNew,remainMoney,"校验开发者账户余额失败");
Assert.assertEquals(status,"success","校验订单状态失败");
logger.info("校验支付宝扣费订单成功");
}
//支付宝兑换接口抽离
public String 支付宝兑换订单(int uid,String alipay,String realname,String degreeId) throws Exception {
Response response = alipayExchangeService.exchange(uid,alipay,realname,degreeId);
......
......@@ -73,7 +73,7 @@ public class 支付宝_兑换流程测试_ExchangeTest extends DuibaTestBase {
}
@Test
//@Test
public void 支付宝审核通过测试() throws Exception{
//查询兑换前的开发者账户余额
......
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