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
7806a43e
Commit
7806a43e
authored
Mar 26, 2019
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
3512cea2
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
0 deletions
+75
-0
自有新优惠券_兑换限制测试.java
...java/http/cases/ExchangeTest/自有_商品兑换限制/自有新优惠券_兑换限制测试.java
+0
-0
自有老优惠券商品_兑换限制测试.java
...va/http/cases/ExchangeTest/自有_商品兑换限制/自有老优惠券商品_兑换限制测试.java
+0
-0
自有老实物_兑换限制测试.java
.../java/http/cases/ExchangeTest/自有_商品兑换限制/自有老实物_兑换限制测试.java
+0
-0
自有老虚拟商品_兑换限制测试.java
...ava/http/cases/ExchangeTest/自有_商品兑换限制/自有老虚拟商品_兑换限制测试.java
+0
-0
CouponExchangeService.java
src/test/java/http/service/app/CouponExchangeService.java
+31
-0
gawService.java
src/test/java/http/service/app/gawService.java
+44
-0
No files found.
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新优惠券_兑换限制测试.java
0 → 100644
View file @
7806a43e
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有老优惠券商品_兑换限制测试.java
0 → 100644
View file @
7806a43e
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有老实物_兑换限制测试.java
0 → 100644
View file @
7806a43e
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有老虚拟商品_兑换限制测试.java
0 → 100644
View file @
7806a43e
This diff is collapsed.
Click to expand it.
src/test/java/http/service/app/CouponExchangeService.java
View file @
7806a43e
...
...
@@ -249,6 +249,37 @@ public class CouponExchangeService {
}
/**
* 虚拟商品兑换接口
* @param cookies
* @param appItemId
* @param degreeId
* @return
* @throws Exception
*/
public
Response
virtualExchange
(
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"
,
"yrJRr7Cddp2YeQd"
);
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
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/virtualExchange/exchange接口返回异常,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/virtualExchange/exchange接口返回异常,返回信息:"
+
response
.
asString
());
}
return
response
;
}
public
Response
objectExchange
(
String
appItemId
,
String
itemId
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appItemId"
,
appItemId
);
...
...
src/test/java/http/service/app/gawService.java
View file @
7806a43e
...
...
@@ -60,6 +60,50 @@ public class gawService {
// Response saveResponse = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).params(map).post("http://"+goodsHost+"/gaw/objectExchange/create");
// response.prettyPrint();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/gaw/objectExchange/create接口返回异常,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/gaw/objectExchange/create接口返回异常,返回信息:"
+
response
.
asString
());
}
return
response
;
}
//优惠券兑换接口
public
Response
couponExchange
(
int
uid
,
String
appItemId
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
mapList
=
new
HashMap
<>();
List
<
Map
>
list
=
new
ArrayList
<>();
mapList
.
put
(
"skuId"
,
38
);
mapList
.
put
(
"appItemId"
,
appItemId
);
mapList
.
put
(
"credits"
,
"100"
);
mapList
.
put
(
"price"
,
0
);
list
.
add
(
mapList
);
map
.
put
(
"remark"
,
""
);
//买家留言
map
.
put
(
"degreeId"
,
""
);
map
.
put
(
"actualPrice"
,
"0"
);
//总金额
map
.
put
(
"actualCredits"
,
"100"
);
//总积分
map
.
put
(
"itemParam"
,
list
.
toArray
());
map
.
put
(
"payType"
,
"3"
);
map
.
put
(
"expressPrice"
,
"0"
);
map
.
put
(
"validate"
,
""
);
map
.
put
(
"token"
,
"yrJRr7Cddp2YeQd"
);
JSONObject
jsonParam
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
logger
.
info
(
"请求实物兑换接口:"
+
"/gaw/couponExchange/create"
);
Response
response
=
given
().
contentType
(
"application/json; charset=UTF-8"
).
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
body
(
jsonParam
).
post
(
"http://"
+
goodsHost
+
"/gaw/couponExchange/create"
);
// Response saveResponse = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).params(map).post("http://"+goodsHost+"/gaw/objectExchange/create");
// response.prettyPrint();
try
{
...
...
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