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
6cdd4e07
Commit
6cdd4e07
authored
Nov 03, 2018
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
3fa9d5b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
41 deletions
+62
-41
Database.java
src/test/java/http/cases/ExchangeTest/Database.java
+1
-0
开发者账户余额校验测试_ExchangeTest.java
...ava/http/cases/ExchangeTest/开发者账户余额校验测试_ExchangeTest.java
+40
-39
DeveloperAccountService.java
src/test/java/http/service/hd/DeveloperAccountService.java
+1
-1
DsOrderService.java
src/test/java/http/service/hd/DsOrderService.java
+20
-1
No files found.
src/test/java/http/cases/ExchangeTest/Database.java
View file @
6cdd4e07
...
...
@@ -12,4 +12,5 @@ public class Database {
public
static
String
orders5
=
"orders_0209"
;
public
static
String
orders6
=
"orders_0210"
;
public
static
String
orders7
=
"orders_0211"
;
public
static
String
orders8
=
"orders_0090"
;
}
src/test/java/http/cases/ExchangeTest/开发者账户余额校验测试.java
→
src/test/java/http/cases/ExchangeTest/开发者账户余额校验测试
_ExchangeTest
.java
View file @
6cdd4e07
...
...
@@ -20,7 +20,7 @@ import java.util.Map;
* Created by lvwenyan on 2018/06/08.
*/
public
class
开发者账户余额校验测试
extends
DuibaTestBase
{
public
class
开发者账户余额校验测试
_ExchangeTest
extends
DuibaTestBase
{
@Autowired
...
...
@@ -42,22 +42,23 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
//指定用户
private
static
int
uid
=
3769
;
//private static int uid = 3769;
private
static
int
uid
=
4386
;
@DataProvider
public
Object
[][]
providerMethod
(
Method
method
)
{
Object
[][]
result
=
null
;
if
(
method
.
getName
().
equals
(
"优惠券审核通过测试"
))
{
if
(
method
.
getName
().
equals
(
"优惠券
兑换
审核通过测试"
))
{
result
=
new
Object
[][]{
new
Object
[]{
1
,
"1
69698
"
,
"29156"
,
"兑吧优惠券审核通过测试"
},
//case1
new
Object
[]{
2
,
"1
72178
"
,
""
,
"自有优惠券审核通过测试"
},
//case2
new
Object
[]{
1
,
"1
84936
"
,
"29156"
,
"兑吧优惠券审核通过测试"
},
//case1
new
Object
[]{
2
,
"1
84937
"
,
""
,
"自有优惠券审核通过测试"
},
//case2
};
}
return
result
;
}
@Test
public
void
商品订单支付宝
审核不通过测试
()
throws
Exception
{
public
void
支付宝兑换
审核不通过测试
()
throws
Exception
{
//查询兑换前的开发者账户余额
// Response accountResponse = developerAccountService.accountInfo();
...
...
@@ -69,7 +70,7 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
logger
.
info
(
"订单号:"
+
orderId
);
//订单审核,判断是否在待审核节点
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
5
+
" WHERE id = "
+
orderId
);
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
8
+
" WHERE id = "
+
orderId
);
String
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
String
orderIdmain
=
String
.
valueOf
(
mapOrder
.
get
(
"order_num"
));
...
...
@@ -77,22 +78,22 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
int
i
=
10
;
while
(
i
>
0
&&
!
flowWork
.
equals
(
"Audit-started"
))
{
Thread
.
sleep
(
300
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
5
+
" WHERE id = "
+
orderId
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
8
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
i
--;
}
//订单审核
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"reject"
);
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"reject"
,
"zhaoran@duiba.com.cn"
);
auditResponse
.
prettyPrint
();
//判断订单是否审核失败
int
j
=
10
;
while
(
j
>
0
&&
!
flowWork
.
equals
(
"Fail-complete"
))
{
Thread
.
sleep
(
1000
);
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"reject"
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
5
+
" WHERE id = "
+
orderId
);
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"reject"
,
"zhaoran@duiba.com.cn"
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
8
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"当前订单节点:"
+
flowWork
);
j
--;
...
...
@@ -117,7 +118,7 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
}
@Test
public
void
Qb
审核通过测试
()
throws
Exception
{
public
void
Qb
兑换
审核通过测试
()
throws
Exception
{
//查询兑换前的开发者账户余额
// Response accountResponse = developerAccountService.accountInfo();
...
...
@@ -125,7 +126,7 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
// logger.info("兑换前的开发者账户余额:" + remainMoney);
// String remainMoneyNew =String.valueOf(Integer.valueOf(remainMoney) - 9600) ;
int
uid
=
2709
;
//
int uid = 2709;
Response
response
=
qbExchangeService
.
doTakePrize
(
authorization
.
dafuwengLogin
(
uid
),
"1234345554"
,
"100"
);
String
orderId
=
(
String
)
response
.
jsonPath
().
get
(
"orderId"
);
...
...
@@ -133,7 +134,7 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
response
.
prettyPrint
();
//订单审核,判断是否在待审核节点
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
from orders_consumer.orders_0616
where id ="
+
orderId
);
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders8
+
"
where id ="
+
orderId
);
String
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
String
orderIdmain
=
String
.
valueOf
(
mapOrder
.
get
(
"order_num"
));
...
...
@@ -141,21 +142,21 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
int
i
=
10
;
while
(
i
>
0
&&
!
flowWork
.
equals
(
"Audit-started"
))
{
Thread
.
sleep
(
300
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
from orders_consumer.orders_0616
where id ="
+
orderId
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders8
+
"
where id ="
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
i
--;
}
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
);
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
,
"zhaoran@duiba.com.cn"
);
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 orders_consumer.orders_0616
where id ="
+
orderId
);
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
,
"zhaoran@duiba.com.cn"
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders8
+
"
where id ="
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
j
--;
...
...
@@ -182,7 +183,7 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
}
@Test
public
void
Qb
审核不通过测试
()
throws
Exception
{
public
void
Qb
兑换
审核不通过测试
()
throws
Exception
{
//查询兑换前的开发者账户余额
// Response accountResponse = developerAccountService.accountInfo();
...
...
@@ -190,12 +191,12 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
// logger.info("兑换前的开发者账户余额:" + remainMoney);
//qb兑换
int
uid
=
2709
;
//
int uid = 2709;
Response
response
=
qbExchangeService
.
doTakePrize
(
authorization
.
dafuwengLogin
(
uid
),
"1234345554"
,
"100"
);
String
orderId
=
(
String
)
response
.
jsonPath
().
get
(
"orderId"
);
//订单审核,判断是否在待审核节点
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
from orders_consumer.orders_0616
where id ="
+
orderId
);
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders8
+
"
where id ="
+
orderId
);
String
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
String
orderIdmain
=
String
.
valueOf
(
mapOrder
.
get
(
"order_num"
));
...
...
@@ -203,22 +204,22 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
int
i
=
10
;
while
(
i
>
0
&&
!
flowWork
.
equals
(
"Audit-started"
))
{
Thread
.
sleep
(
300
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
from orders_consumer.orders_0616
where id ="
+
orderId
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders8
+
"
where id ="
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
i
--;
}
//订单审核
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"reject"
);
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"reject"
,
"zhaoran@duiba.com.cn"
);
auditResponse
.
prettyPrint
();
//判断订单是否审核失败
int
j
=
10
;
while
(
j
>
0
&&
!
flowWork
.
equals
(
"Fail-complete"
))
{
Thread
.
sleep
(
1000
);
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"reject"
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
from orders_consumer.orders_0616
where id ="
+
orderId
);
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"reject"
,
"zhaoran@duiba.com.cn"
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT *
FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders8
+
"
where id ="
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"当前订单节点:"
+
flowWork
);
j
--;
...
...
@@ -252,8 +253,8 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
* @throws Exception
*/
@Test
(
dataProvider
=
"providerMethod"
)
public
void
优惠券审核通过测试
(
int
caseNum
,
String
appItemId
,
String
itemId
,
String
caseName
)
throws
Exception
{
int
uid
=
3768
;
public
void
优惠券
兑换
审核通过测试
(
int
caseNum
,
String
appItemId
,
String
itemId
,
String
caseName
)
throws
Exception
{
//
int uid = 3768;
logger
.
info
(
caseName
);
//查询兑换前的开发者余额
// Response accountResponse = developerAccountService.accountInfo();
...
...
@@ -266,7 +267,7 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
logger
.
info
(
"订单号:"
+
orderId
);
//订单审核,判断是否在待审核节点
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
4
+
" WHERE id = "
+
orderId
);
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
8
+
" WHERE id = "
+
orderId
);
String
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
String
orderIdmain
=
String
.
valueOf
(
mapOrder
.
get
(
"order_num"
));
...
...
@@ -274,21 +275,21 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
int
i
=
10
;
while
(
i
>
0
&&
!
flowWork
.
equals
(
"Audit-started"
))
{
Thread
.
sleep
(
300
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
4
+
" WHERE id = "
+
orderId
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
8
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
i
--;
}
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
);
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
,
"zhaoran@duiba.com.cn"
);
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
.
orders
4
+
" WHERE id = "
+
orderId
);
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
,
"zhaoran@duiba.com.cn"
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
8
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
j
--;
...
...
@@ -325,8 +326,8 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
}
@Test
public
void
支付宝审核通过测试
()
throws
Exception
{
int
uid
=
3771
;
public
void
支付宝
兑换
审核通过测试
()
throws
Exception
{
//
int uid = 3771;
//查询兑换前的开发者账户余额
// Response accountResponse = developerAccountService.accountInfo();
// String remainMoney = accountResponse.jsonPath().getString("data.remainMoney");
...
...
@@ -338,7 +339,7 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
logger
.
info
(
"订单号:"
+
orderId
);
//订单审核,判断是否在待审核节点
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
7
+
" WHERE id = "
+
orderId
);
Map
<
String
,
Object
>
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
8
+
" WHERE id = "
+
orderId
);
String
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
String
orderIdmain
=
String
.
valueOf
(
mapOrder
.
get
(
"order_num"
));
...
...
@@ -346,21 +347,21 @@ public class 开发者账户余额校验测试 extends DuibaTestBase {
int
i
=
10
;
while
(
i
>
0
&&
!
flowWork
.
equals
(
"Audit-started"
))
{
Thread
.
sleep
(
300
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
7
+
" WHERE id = "
+
orderId
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
8
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
i
--;
}
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
);
Response
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
,
"zhaoran@duiba.com.cn"
);
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
.
orders
7
+
" WHERE id = "
+
orderId
);
auditResponse
=
dsOrderService
.
submitAudit
(
orderId
,
"pass"
,
"zhaoran@duiba.com.cn"
);
mapOrder
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders
8
+
" WHERE id = "
+
orderId
);
flowWork
=
String
.
valueOf
(
mapOrder
.
get
(
"flowwork_stage"
));
logger
.
info
(
"数据库订单节点:"
+
flowWork
);
j
--;
...
...
src/test/java/http/service/hd/DeveloperAccountService.java
View file @
6cdd4e07
...
...
@@ -76,7 +76,7 @@ public class DeveloperAccountService {
map
.
put
(
"mode"
,
"two"
);
map
.
put
(
"orderId"
,
orderId
);
map
.
put
(
"rowId"
,
"1"
);
Response
response
=
given
().
cookies
(
authorization
.
hdLogin
(
)).
params
(
map
).
get
(
"http://"
+
url
);
Response
response
=
given
().
cookies
(
authorization
.
hdLogin
Common
(
"zhaoran@duiba.com.cn"
)).
params
(
map
).
get
(
"http://"
+
url
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/developerAccount/cashDetail接口失败"
);
...
...
src/test/java/http/service/hd/DsOrderService.java
View file @
6cdd4e07
...
...
@@ -49,9 +49,28 @@ public class DsOrderService {
throw
new
Exception
(
"请求订单审核接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
//审核订单
public
Response
submitAudit
(
String
idArray
,
String
audit
,
String
email
)
throws
Exception
{
String
url
=
hdHost
+
"/dsOrder/submitAudit"
;
}
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
"18714"
);
map
.
put
(
"idArray"
,
idArray
);
map
.
put
(
"audit"
,
audit
);
map
.
put
(
"reason"
,
"测试订单审核不通过"
);
logger
.
info
(
"请求订单审核接口:"
+
url
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginCommon
(
email
)).
params
(
map
).
post
(
"http://"
+
url
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"成功"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"请求订单审核接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"请求订单审核接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
}
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