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
347695d5
Commit
347695d5
authored
Mar 29, 2019
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
3d0f5d38
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
168 additions
and
0 deletions
+168
-0
总帐户账户正常提现.java
src/test/java/http/cases/WalletTest/总帐户账户正常提现.java
+0
-0
GlobalRewardService.java
src/test/java/http/service/Activity/GlobalRewardService.java
+168
-0
No files found.
src/test/java/http/cases/WalletTest/总帐户账户正常提现.java
0 → 100644
View file @
347695d5
This diff is collapsed.
Click to expand it.
src/test/java/http/service/Activity/GlobalRewardService.java
0 → 100644
View file @
347695d5
package
http
.
service
.
Activity
;
import
base.DuibaLog
;
import
http.service.Authorization
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.testng.Assert
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
io
.
restassured
.
RestAssured
.
given
;
/**
* Created by zhaoran on 2019/03/29
*/
@Service
public
class
GlobalRewardService
{
@Autowired
Authorization
authorization
;
@Value
(
"${activity.host}"
)
String
activityHost
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
/**
* 获取红包账户
* @param cookies
* @return
* @throws Exception
*/
public
Response
getWalletAccount
(
Map
cookies
)
throws
Exception
{
logger
.
info
(
"请求getWalletAccount"
);
Response
response
=
given
().
cookies
(
cookies
).
get
(
activityHost
+
"/walletAccount/getWalletAccount"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/walletAccount/getWalletAccount接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/walletAccount/getWalletAccount接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/walletAccount/getWalletAccount接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
/**
* 红包账户提现
* @param cookies
* @param amount
* @param account
* @param username
* @return
* @throws Exception
*/
public
Response
withdraw
(
Map
cookies
,
String
amount
,
String
account
,
String
username
)
throws
Exception
{
logger
.
info
(
"请求withdraw"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"amount"
,
amount
);
map
.
put
(
"account"
,
account
);
map
.
put
(
"username"
,
username
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/globalReward/withdraw"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/walletAccount/doTakePrize接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/globalReward/withdraw接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/globalReward/withdraw接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
/**
* 红包账户提现
* @param cookies
* @param orderId
* @return
* @throws Exception
*/
public
Response
getOrderStatus
(
Map
cookies
,
String
orderId
)
throws
Exception
{
logger
.
info
(
"请求getOrderStatus"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderId"
,
orderId
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/walletAccount/getOrderStatus"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/walletAccount/getOrderStatus接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/walletAccount/getOrderStatus接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/walletAccount/getOrderStatus接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
public
Response
getOrderStatus2
(
Map
cookies
,
String
orderId
)
throws
Exception
{
logger
.
info
(
"请求getOrderStatus"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"orderId"
,
orderId
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/walletAccount/getOrderStatus"
);
return
response
;
}
/**
* 红包账户提现记录
* @param cookies
* @return
* @throws Exception
*/
public
Response
walletDetail
(
Map
cookies
)
throws
Exception
{
logger
.
info
(
"请求walletDetail"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"pageNo"
,
"1"
);
map
.
put
(
"pageSize"
,
"12"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
get
(
activityHost
+
"/walletAccount/walletDetail"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/walletAccount/walletDetail接口失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/walletAccount/walletDetail接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/walletAccount/walletDetail接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
/**
* 红包账户修改钱包账户余额后门
* @param consumerId
* @param accountType
* @param balanceAmount
* @return
* @throws Exception
*/
public
void
updateConsumerAccount
(
String
consumerId
,
String
accountType
,
String
balanceAmount
)
throws
Exception
{
logger
.
info
(
"请求修改钱包账户余额后门:updateConsumerAccount"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"consumerId"
,
consumerId
);
map
.
put
(
"accountType"
,
accountType
);
map
.
put
(
"balanceAmount"
,
balanceAmount
);
Response
response
=
given
().
params
(
map
).
get
(
activityHost
+
"/aaw/automated/updateConsumerAccount"
);
// try{
// Assert.assertEquals(response.jsonPath().getString("success"),"true","/walletAccount/walletDetail接口失败");
//
// }catch(Exception e){
// throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+response.asString());
// }catch(Error er){
// throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+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