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
8f47fb4a
Commit
8f47fb4a
authored
Nov 16, 2018
by
panyuli
Browse files
Options
Browse Files
Download
Plain Diff
zr
parents
663e8c3e
828c52e4
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
优惠券_兑换异常测试_ExchangeTest.java
...java/http/cases/ExchangeTest/优惠券_兑换异常测试_ExchangeTest.java
+2
-1
虚拟商品_兑换异常测试_ExchangeTest.java
...ava/http/cases/ExchangeTest/虚拟商品_兑换异常测试_ExchangeTest.java
+0
-0
VirtualExchangeService.java
src/test/java/http/service/app/VirtualExchangeService.java
+24
-0
No files found.
src/test/java/http/cases/ExchangeTest/优惠券_兑换
流程测试pyl
_ExchangeTest.java
→
src/test/java/http/cases/ExchangeTest/优惠券_兑换
异常测试
_ExchangeTest.java
View file @
8f47fb4a
...
...
@@ -23,7 +23,8 @@ import static io.restassured.RestAssured.given;
* Created by panyuli on 2018/07/06.
*/
public
class
优惠券
_
兑换流程测试
pyl_ExchangeTest
extends
CheckTemplet
{
public
class
优惠券
_
兑换异常测试
_ExchangeTest
extends
CheckTemplet
{
@Autowired
private
MobileService
mobileService
;
...
...
src/test/java/http/cases/ExchangeTest/虚拟商品_兑换异常测试_ExchangeTest.java
0 → 100644
View file @
8f47fb4a
This diff is collapsed.
Click to expand it.
src/test/java/http/service/app/VirtualExchangeService.java
View file @
8f47fb4a
...
...
@@ -42,4 +42,28 @@ public class VirtualExchangeService {
return
response
;
}
public
Response
exchange2
(
Map
cookies
,
String
appItemId
,
String
degreeId
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appItemId"
,
appItemId
);
map
.
put
(
"degreeId"
,
degreeId
);
map
.
put
(
"token"
,
"xz9eyi"
);
logger
.
info
(
"请求/virtualExchange/exchange接口"
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
cookies
).
params
(
map
).
post
(
"http://"
+
goodsHost
+
"/virtualExchange/exchange"
);
//couponExchange
try
{
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
getStatusCode
()),
"200"
,
"/objectExchange/exchange接口返回异常"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/objectExchange/exchange接口返回异常,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/objectExchange/exchange接口返回异常,返回信息:"
+
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