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
59e262e2
Commit
59e262e2
authored
Jul 10, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv
parent
796aa58d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
Database.java
src/test/java/http/cases/ExchangeTest/Database.java
+2
-0
新支付宝_兑换流程测试_ExchangeTest.java
...ses/ExchangeTest/兑吧_直充类商品兑换/新支付宝_兑换流程测试_ExchangeTest.java
+34
-3
No files found.
src/test/java/http/cases/ExchangeTest/Database.java
View file @
59e262e2
...
@@ -16,6 +16,8 @@ public class Database {
...
@@ -16,6 +16,8 @@ public class Database {
public
static
String
orders9
=
"orders_0203"
;
public
static
String
orders9
=
"orders_0203"
;
public
static
String
orders10
=
"orders_0411"
;
public
static
String
orders10
=
"orders_0411"
;
public
static
String
orders11
=
"orders_0182"
;
public
static
String
orders11
=
"orders_0182"
;
public
static
String
orders12
=
"orders_0715"
;
}
}
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新支付宝_兑换流程测试_ExchangeTest.java
View file @
59e262e2
package
http
.
cases
.
ExchangeTest
.
兑吧
_
直充类商品兑换
;
package
http
.
cases
.
ExchangeTest
.
兑吧
_
直充类商品兑换
;
import
http.cases.ExchangeTest.CheckTemplet
;
import
http.cases.ExchangeTest.CheckTemplet
;
import
http.cases.ExchangeTest.Database
;
import
http.service.Authorization
;
import
http.service.Authorization
;
import
http.service.Manager.ADeveloperService
;
import
http.service.Manager.ADeveloperService
;
import
http.service.app.gawService
;
import
http.service.app.gawService
;
...
@@ -243,8 +244,8 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -243,8 +244,8 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"支付宝
支付宝
档位篡改测试"
)
@Test
(
description
=
"支付宝档位篡改测试"
)
public
void
支付宝档位
限制
测试
()
throws
Exception
{
public
void
支付宝档位
篡改
测试
()
throws
Exception
{
int
uid
=
7271
;
int
uid
=
7271
;
String
actualCredits
=
"4"
;
String
actualCredits
=
"4"
;
...
@@ -265,11 +266,41 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -265,11 +266,41 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"档位不存在\""
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"档位不存在\""
),
"校验message失败"
);
logger
.
info
(
"校验支付宝档位
限制
成功"
);
logger
.
info
(
"校验支付宝档位
篡改无法兑换
成功"
);
}
}
@Test
(
description
=
"支付宝积分篡改测试"
)
public
void
支付宝积分篡改测试
()
throws
Exception
{
int
uid
=
7271
;
String
actualCredits
=
"0"
;
String
degreeId
=
"10"
;
String
appItemId
=
"196921"
;
String
credits
=
"0"
;
String
message
=
""
;
//支付宝兑换,积分为0
Response
response
=
gawService
.
alipayExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response
.
prettyPrint
();
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderId"
);
//查询数据库
Map
<
String
,
Object
>
mapOrderId
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders12
+
" where id = "
+
orderId
);
String
orderStatus
=
String
.
valueOf
(
mapOrderId
.
get
(
"status"
));
String
orderCredits
=
String
.
valueOf
(
mapOrderId
.
get
(
"credits"
));
logger
.
info
(
"订单积分:"
+
orderCredits
);
Assert
.
assertEquals
(
orderStatus
,
"consume_success"
,
"校验status失败"
);
Assert
.
assertEquals
(
orderCredits
,
"10"
,
"校验credits失败"
);
logger
.
info
(
"校验支付宝积分篡改兑换成功"
);
}
public
Response
支付宝兑换
(
int
uid
,
String
actualCredits
,
String
degreeId
,
String
appItemId
,
String
credits
)
throws
Exception
{
public
Response
支付宝兑换
(
int
uid
,
String
actualCredits
,
String
degreeId
,
String
appItemId
,
String
credits
)
throws
Exception
{
...
...
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