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
d60253a8
Commit
d60253a8
authored
Mar 11, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
62d18de2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
实物_兑换异常测试_ExchangeTest.java
.../java/http/cases/ExchangeTest/实物_兑换异常测试_ExchangeTest.java
+44
-0
CouponExchangeService.java
src/test/java/http/service/app/CouponExchangeService.java
+1
-0
No files found.
src/test/java/http/cases/ExchangeTest/实物_兑换异常测试_ExchangeTest.java
View file @
d60253a8
...
...
@@ -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"));
}
}
src/test/java/http/service/app/CouponExchangeService.java
View file @
d60253a8
...
...
@@ -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
);
...
...
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