Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oto
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
龚小红
oto
Commits
c0a8259e
Commit
c0a8259e
authored
Apr 01, 2021
by
张慧锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释优惠券付费
parent
8cb87fa7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
Pay.java
src/test/java/com/kjj/cases/basics/Pay.java
+29
-29
No files found.
src/test/java/com/kjj/cases/basics/Pay.java
View file @
c0a8259e
...
...
@@ -115,35 +115,35 @@ public class Pay {
Assert
.
assertEquals
(
userVersion
,
changeVersion
,
network
.
message
(
params
,
VERSION_INFO
,
"会员类型版本判断:判断错误,此版本为尊享版"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"优惠券付费"
,
priority
=
5
)
public
void
优惠券付费
()
throws
IOException
{
String
promotionCode
=
BaseUtils
.
getPromotionCode
();
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"code"
,
promotionCode
);
Response
response
=
network
.
getResponse
(
params
,
PAY_COMBOLIST
);
Map
<
String
,
Object
>
payParams
=
new
HashMap
<
String
,
Object
>();
payParams
.
put
(
"userVersion"
,
2
);
// 1 通用版 2 保险版
payParams
.
put
(
"comboId"
,
"Kj21MTU"
);
payParams
.
put
(
"oaId"
,
"1"
);
payParams
.
put
(
"paySource"
,
"101004"
);
payParams
.
put
(
"sellerFrom"
,
""
);
payParams
.
put
(
"promotionCode"
,
promotionCode
);
response
=
network
.
postResponse
(
payParams
,
PAY_ORDERCREATE
);
String
tradeNo
=
response
.
jsonPath
().
getString
(
"data.tradeNo"
);
response
.
body
().
prettyPrint
();
// mock微信回调成功
Map
<
String
,
Object
>
callbackParams
=
new
HashMap
<
String
,
Object
>();
callbackParams
.
put
(
"tradeNo"
,
tradeNo
);
callbackParams
.
put
(
"payResult"
,
true
);
callbackParams
.
put
(
"payTradeNo"
,
"test"
);
response
=
network
.
getResponse
(
callbackParams
,
PAY_CALLOUT
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data"
);
response
.
body
().
prettyPrint
();
Assert
.
assertTrue
(
result
,
network
.
message
(
callbackParams
,
PAY_CALLOUT
,
"mock微信支付回调成功,但我们订单处理失败"
,
response
.
body
().
asString
()));
}
//
@Test (description = "优惠券付费",priority = 5)
//
public void 优惠券付费 () throws IOException {
//
String promotionCode = BaseUtils.getPromotionCode();
//
Map<String, Object> params = new HashMap<String, Object>();
//
params.put("code",promotionCode);
//
Response response = network.getResponse(params,PAY_COMBOLIST);
//
//
Map<String, Object> payParams = new HashMap<String, Object>();
//
payParams.put("userVersion",2); // 1 通用版 2 保险版
//
payParams.put("comboId","Kj21MTU");
//
payParams.put("oaId","1");
//
payParams.put("paySource","101004");
//
payParams.put("sellerFrom","");
//
payParams.put("promotionCode",promotionCode);
//
//
response = network.postResponse(payParams,PAY_ORDERCREATE);
//
String tradeNo = response.jsonPath().getString("data.tradeNo");
//
response.body().prettyPrint();
//
//
// mock微信回调成功
//
Map<String, Object> callbackParams = new HashMap<String, Object>();
//
callbackParams.put("tradeNo",tradeNo);
//
callbackParams.put("payResult",true);
//
callbackParams.put("payTradeNo","test");
//
response = network.getResponse(callbackParams,PAY_CALLOUT);
//
boolean result = response.jsonPath().getBoolean("data");
//
response.body().prettyPrint();
//
Assert.assertTrue(result,network.message(callbackParams,PAY_CALLOUT,"mock微信支付回调成功,但我们订单处理失败",response.body().asString()));
//
}
@Test
(
description
=
"默认付费_微信支付后回调"
,
priority
=
6
)
public
void
默认付费
_
微信支付后回调
()
throws
IOException
{
...
...
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