Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马博
test-platform
Commits
7ecd2884
Commit
7ecd2884
authored
Nov 03, 2018
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
c4a65b3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
1 deletion
+61
-1
开发者账户余额校验测试_ExchangeTest.java
...ava/http/cases/ExchangeTest/开发者账户余额校验测试_ExchangeTest.java
+60
-0
支付宝_兑换流程测试_ExchangeTest.java
...java/http/cases/ExchangeTest/支付宝_兑换流程测试_ExchangeTest.java
+1
-1
No files found.
src/test/java/http/cases/ExchangeTest/开发者账户余额校验测试_ExchangeTest.java
View file @
7ecd2884
...
...
@@ -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
);
...
...
src/test/java/http/cases/ExchangeTest/支付宝_兑换流程测试_ExchangeTest.java
View file @
7ecd2884
...
...
@@ -73,7 +73,7 @@ public class 支付宝_兑换流程测试_ExchangeTest extends DuibaTestBase {
}
@Test
//
@Test
public
void
支付宝审核通过测试
()
throws
Exception
{
//查询兑换前的开发者账户余额
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment