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
75b9dd0d
Commit
75b9dd0d
authored
Jul 16, 2019
by
吕雯燕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'duiba_wenyan'
parents
9aa4ba4e
fc46d50f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
189 additions
and
7 deletions
+189
-7
Database.java
src/test/java/http/cases/ExchangeTest/Database.java
+3
-0
新Qb_兑换流程测试_ExchangeTest.java
...ases/ExchangeTest/兑吧_直充类商品兑换/新Qb_兑换流程测试_ExchangeTest.java
+82
-1
新多档位话费_兑换流程测试_ExchangeTest.java
...s/ExchangeTest/兑吧_直充类商品兑换/新多档位话费_兑换流程测试_ExchangeTest.java
+81
-0
新支付宝_兑换流程测试_ExchangeTest.java
...ses/ExchangeTest/兑吧_直充类商品兑换/新支付宝_兑换流程测试_ExchangeTest.java
+23
-6
No files found.
src/test/java/http/cases/ExchangeTest/Database.java
View file @
75b9dd0d
...
@@ -16,6 +16,9 @@ public class Database {
...
@@ -16,6 +16,9 @@ public class Database {
public
static
String
orders12
=
"orders_0715"
;
public
static
String
orders12
=
"orders_0715"
;
public
static
String
orders13
=
"orders_0717"
;
public
static
String
orders13
=
"orders_0717"
;
public
static
String
orders14
=
"orders_0712"
;
public
static
String
orders14
=
"orders_0712"
;
public
static
String
orders15
=
"orders_0718"
;
public
static
String
orders16
=
"orders_0721"
;
...
...
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新Qb_兑换流程测试_ExchangeTest.java
View file @
75b9dd0d
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.app.gawService
;
import
http.service.app.gawService
;
import
http.service.app.MobileService
;
import
http.service.app.MobileService
;
...
@@ -165,7 +166,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -165,7 +166,7 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
logger
.
info
(
"用户成功兑换一次"
);
logger
.
info
(
"用户成功兑换一次"
);
//再次兑换
//再次兑换
Thread
.
sleep
(
3
000
);
Thread
.
sleep
(
4
000
);
try
{
try
{
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
"123456789"
);
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
"123456789"
);
response
.
prettyPrint
();
response
.
prettyPrint
();
...
@@ -243,6 +244,86 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -243,6 +244,86 @@ public class 新Qb_兑换流程测试_ExchangeTest extends CheckTemplet {
}
}
@Test
(
description
=
"Q币档位篡改测试"
)
public
void
Q
币档位篡改测试
()
throws
Exception
{
int
uid
=
7293
;
String
actualCredits
=
"3"
;
String
degreeId
=
"100"
;
String
appItemId
=
"196922"
;
String
credits
=
"3"
;
String
qq
=
"806854056"
;
String
message
=
""
;
//Q币兑换,档位参数不存在
try
{
Response
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"档位不存在\""
),
"校验message失败"
);
logger
.
info
(
"校验Q币档位篡改无法兑换成功"
);
}
@Test
(
description
=
"Q币用户id篡改测试"
)
public
void
Q
币用户
id
篡改测试
()
throws
Exception
{
//商品: lv测试应用77
//uid1: 大富翁app
//uid2: lv测试应用88
int
uid1
=
7084
;
int
uid2
=
7292
;
String
actualCredits
=
"3"
;
String
degreeId
=
"3"
;
String
appItemId
=
"196922"
;
String
credits
=
"3"
;
String
qq
=
"806854056"
;
String
message
=
""
;
//话费兑换, 大富翁app已上架Q币
Response
response
=
gawService
.
qbExchange
(
uid1
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
response
.
prettyPrint
();
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderId"
);
//查询数据库
Thread
.
sleep
(
3000
);
Map
<
String
,
Object
>
mapOrderId
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders16
+
" where id = "
+
orderId
);
String
orderStatus
=
String
.
valueOf
(
mapOrderId
.
get
(
"status"
));
String
orderappId
=
String
.
valueOf
(
mapOrderId
.
get
(
"app_id"
));
String
orderCredits
=
String
.
valueOf
(
mapOrderId
.
get
(
"credits"
));
logger
.
info
(
"订单积分:"
+
orderCredits
);
Assert
.
assertEquals
(
orderStatus
,
"consume_success"
,
"校验status失败"
);
Assert
.
assertEquals
(
orderappId
,
"1"
,
"校验appId失败"
);
Assert
.
assertEquals
(
orderCredits
,
"300"
,
"校验credits失败"
);
logger
.
info
(
"校验Q币用户id1篡改兑换成功"
);
//Q币兑换,lv测试应用88app未上架Q币
try
{
Response
response2
=
gawService
.
qbExchange
(
uid2
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
response2
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"兑吧加钱购商品不可以加入到开发者商品中\""
),
"校验message失败"
);
//这个提示很奇怪
logger
.
info
(
"校验Q币用户id2篡改无法兑换成功"
);
}
public
Response
Q
币兑换
(
int
uid
,
String
actualCredits
,
String
degreeId
,
String
appItemId
,
String
credits
,
String
qq
)
throws
Exception
{
public
Response
Q
币兑换
(
int
uid
,
String
actualCredits
,
String
degreeId
,
String
appItemId
,
String
credits
,
String
qq
)
throws
Exception
{
Response
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
Response
response
=
gawService
.
qbExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
,
qq
);
...
...
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新多档位话费_兑换流程测试_ExchangeTest.java
View file @
75b9dd0d
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.app.gawService
;
import
http.service.app.gawService
;
import
http.service.app.MobileService
;
import
http.service.app.MobileService
;
...
@@ -240,6 +241,86 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
...
@@ -240,6 +241,86 @@ public class 新多档位话费_兑换流程测试_ExchangeTest extends CheckTem
}
}
@Test
(
description
=
"话费档位篡改测试"
)
public
void
话费档位篡改测试
()
throws
Exception
{
int
uid
=
7268
;
String
actualCredits
=
"2"
;
String
degreeId
=
"100"
;
String
appItemId
=
"196923"
;
String
credits
=
"2"
;
String
message
=
""
;
//话费兑换,档位参数不存在
try
{
Thread
.
sleep
(
3000
);
Response
response
=
gawService
.
phonebillExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"档位不存在\""
),
"校验message失败"
);
logger
.
info
(
"校验话费档位篡改无法兑换成功"
);
}
@Test
(
description
=
"话费用户id篡改测试"
)
public
void
话费用户
id
篡改测试
()
throws
Exception
{
//商品: lv测试应用77
//uid1: 大富翁app
//uid2: lv测试应用88
int
uid1
=
7085
;
int
uid2
=
7292
;
String
actualCredits
=
"5"
;
String
degreeId
=
"10"
;
String
appItemId
=
"196923"
;
String
credits
=
"5"
;
String
message
=
""
;
//话费兑换, 大富翁app已上架话费
Response
response
=
gawService
.
phonebillExchange
(
uid1
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response
.
prettyPrint
();
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderId"
);
//查询数据库
Thread
.
sleep
(
3000
);
Map
<
String
,
Object
>
mapOrderId
=
jdbc
.
findSimpleResult
(
"SELECT * FROM "
+
Database
.
orders_consumer
+
"."
+
Database
.
orders15
+
" where id = "
+
orderId
);
String
orderStatus
=
String
.
valueOf
(
mapOrderId
.
get
(
"status"
));
String
orderappId
=
String
.
valueOf
(
mapOrderId
.
get
(
"app_id"
));
String
orderCredits
=
String
.
valueOf
(
mapOrderId
.
get
(
"credits"
));
logger
.
info
(
"订单积分:"
+
orderCredits
);
Assert
.
assertEquals
(
orderStatus
,
"consume_success"
,
"校验status失败"
);
Assert
.
assertEquals
(
orderappId
,
"1"
,
"校验appId失败"
);
Assert
.
assertEquals
(
orderCredits
,
"1000"
,
"校验credits失败"
);
logger
.
info
(
"校验话费用户id1篡改兑换成功"
);
//话费兑换,lv测试应用88app未上架话费
try
{
Response
response2
=
gawService
.
phonebillExchange
(
uid2
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response2
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"无权访问\""
),
"校验message失败"
);
logger
.
info
(
"校验话费用户id2篡改无法兑换成功"
);
}
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
{
Response
response
=
gawService
.
phonebillExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
Response
response
=
gawService
.
phonebillExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
...
...
src/test/java/http/cases/ExchangeTest/兑吧_直充类商品兑换/新支付宝_兑换流程测试_ExchangeTest.java
View file @
75b9dd0d
...
@@ -303,19 +303,21 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -303,19 +303,21 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
@Test
(
description
=
"支付宝用户id修改测试"
)
@Test
(
description
=
"支付宝用户id修改测试"
)
public
void
支付宝用户
id
修
改测试
()
throws
Exception
{
public
void
支付宝用户
id
篡
改测试
()
throws
Exception
{
//uid: 大富翁app
//商品: lv测试应用77
//商品: lv测试应用77
int
uid
=
7204
;
//uid1: 大富翁app
//uid2: lv测试应用88
int
uid1
=
7204
;
int
uid2
=
7291
;
String
actualCredits
=
"10"
;
String
actualCredits
=
"10"
;
String
degreeId
=
"10"
;
String
degreeId
=
"10"
;
String
appItemId
=
"196921"
;
String
appItemId
=
"196921"
;
String
credits
=
"10"
;
String
credits
=
"10"
;
String
message
=
""
;
String
message
=
""
;
//支付宝兑换,
走大富翁app的
支付宝
//支付宝兑换,
大富翁app已上架
支付宝
Response
response
=
gawService
.
alipayExchange
(
uid
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
Response
response
=
gawService
.
alipayExchange
(
uid
1
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response
.
prettyPrint
();
response
.
prettyPrint
();
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderId"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderId"
);
...
@@ -330,7 +332,22 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
...
@@ -330,7 +332,22 @@ public class 新支付宝_兑换流程测试_ExchangeTest extends CheckTemplet {
Assert
.
assertEquals
(
orderStatus
,
"consume_success"
,
"校验status失败"
);
Assert
.
assertEquals
(
orderStatus
,
"consume_success"
,
"校验status失败"
);
Assert
.
assertEquals
(
orderappId
,
"1"
,
"校验appId失败"
);
Assert
.
assertEquals
(
orderappId
,
"1"
,
"校验appId失败"
);
Assert
.
assertEquals
(
orderCredits
,
"1000"
,
"校验credits失败"
);
Assert
.
assertEquals
(
orderCredits
,
"1000"
,
"校验credits失败"
);
logger
.
info
(
"校验支付宝用户id修改兑换成功"
);
logger
.
info
(
"校验支付宝用户id1篡改兑换成功"
);
//支付宝兑换,lv测试应用88app未上架支付宝
try
{
Response
response2
=
gawService
.
alipayExchange
(
uid2
,
actualCredits
,
degreeId
,
appItemId
,
credits
);
response2
.
prettyPrint
();
}
catch
(
Exception
e
){
message
=
e
.
toString
();
}
logger
.
info
(
message
);
Assert
.
assertTrue
(
message
.
contains
(
"\"success\":false"
),
"校验message失败"
);
Assert
.
assertTrue
(
message
.
contains
(
"\"desc\":\"商家未采购商品\""
),
"校验message失败"
);
logger
.
info
(
"校验支付宝用户id2篡改无法兑换成功"
);
...
...
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