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
828c52e4
Commit
828c52e4
authored
Nov 16, 2018
by
panyuli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
panyuli
parent
3f5b963f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
优惠券_兑换异常测试_ExchangeTest.java
...java/http/cases/ExchangeTest/优惠券_兑换异常测试_ExchangeTest.java
+1
-1
虚拟商品_兑换异常测试_ExchangeTest.java
...ava/http/cases/ExchangeTest/虚拟商品_兑换异常测试_ExchangeTest.java
+1
-1
VirtualExchangeService.java
src/test/java/http/service/app/VirtualExchangeService.java
+24
-0
No files found.
src/test/java/http/cases/ExchangeTest/优惠券_兑换异常测试_ExchangeTest.java
View file @
828c52e4
...
...
@@ -32,7 +32,7 @@ import static io.restassured.RestAssured.given;
* Created by panyuli on 2018/07/06.
*/
public
class
优惠券
_
兑换
流程测试
pyl
_ExchangeTest
extends
DuibaTestBase
{
public
class
优惠券
_
兑换
异常测试
_ExchangeTest
extends
DuibaTestBase
{
@Autowired
private
MobileService
mobileService
;
...
...
src/test/java/http/cases/ExchangeTest/虚拟商品_兑换异常测试_ExchangeTest.java
View file @
828c52e4
...
...
@@ -20,7 +20,7 @@ import java.util.Map;
/**
* Created by panyuli on 2018/6/11.
*/
public
class
虚拟商品
_
兑换异常测试
1
_ExchangeTest
extends
DuibaTestBase
{
public
class
虚拟商品
_
兑换异常测试
_ExchangeTest
extends
DuibaTestBase
{
@Autowired
private
MobileService
mobileService
;
...
...
src/test/java/http/service/app/VirtualExchangeService.java
View file @
828c52e4
...
...
@@ -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