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
b11ff4ea
Commit
b11ff4ea
authored
Dec 19, 2018
by
周松波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c0956140
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
27 deletions
+96
-27
ContractSignCommon.java
src/test/java/http/cases/SignTest/ContractSignCommon.java
+16
-0
ContractSign_signTest.java
src/test/java/http/cases/SignTest/ContractSign_signTest.java
+57
-26
ContractSignService.java
src/test/java/http/service/Activity/ContractSignService.java
+23
-1
No files found.
src/test/java/http/cases/SignTest/ContractSignCommon.java
View file @
b11ff4ea
...
@@ -12,6 +12,7 @@ import http.service.Authorization;
...
@@ -12,6 +12,7 @@ import http.service.Authorization;
import
http.service.hd.SigninService
;
import
http.service.hd.SigninService
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -38,6 +39,21 @@ public class ContractSignCommon extends DuibaTestBase{
...
@@ -38,6 +39,21 @@ public class ContractSignCommon extends DuibaTestBase{
String
activityHost
;
String
activityHost
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
public
Response
queryRewardResult
(
String
ContractId
,
int
uid
)
throws
Exception
{
Response
response
=
ContractSignService
.
queryRewardStatus
(
ContractId
,
uid
);;
String
rewardStatus
=
response
.
jsonPath
().
getString
(
"data.rewardStatus"
);
int
num
=
10
;
while
(
rewardStatus
.
equals
(
"0"
)
&&
num
>
0
)
{
response
=
ContractSignService
.
queryRewardStatus
(
ContractId
,
uid
);
rewardStatus
=
response
.
jsonPath
().
getString
(
"data.rewardStatus"
);
if
(
rewardStatus
.
equals
(
"2"
))
{
break
;
}
num
--;
Thread
.
sleep
(
1000
);
}
return
response
;
}
public
Map
<
String
,
String
>
doJoinResult
(
String
activityId
,
String
betAmount
,
int
uid
)
throws
Exception
{
public
Map
<
String
,
String
>
doJoinResult
(
String
activityId
,
String
betAmount
,
int
uid
)
throws
Exception
{
Response
doJoinRes
=
ContractSignService
.
doJoin
(
activityId
,
betAmount
,
uid
);
Response
doJoinRes
=
ContractSignService
.
doJoin
(
activityId
,
betAmount
,
uid
);
String
contractId
=
doJoinRes
.
jsonPath
().
getString
(
"data.contractId"
);
String
contractId
=
doJoinRes
.
jsonPath
().
getString
(
"data.contractId"
);
...
...
src/test/java/http/cases/SignTest/ContractSign_signTest.java
View file @
b11ff4ea
This diff is collapsed.
Click to expand it.
src/test/java/http/service/Activity/ContractSignService.java
View file @
b11ff4ea
...
@@ -205,7 +205,7 @@ public class ContractSignService {
...
@@ -205,7 +205,7 @@ public class ContractSignService {
public
Response
getReward
(
String
ContractId
,
int
uid
)
throws
Exception
{
public
Response
getReward
(
String
ContractId
,
int
uid
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"contractId"
,
ContractId
);
map
.
put
(
"contractId"
,
ContractId
);
logger
.
info
(
"请求getReward接口,
签到活动
id="
+
ContractId
);
logger
.
info
(
"请求getReward接口,
契约
id="
+
ContractId
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
activityHost
+
"/sign/contract/getReward"
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
post
(
activityHost
+
"/sign/contract/getReward"
);
try
{
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/sign/contract/getReward接口请求失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/sign/contract/getReward接口请求失败"
);
...
@@ -216,4 +216,26 @@ public class ContractSignService {
...
@@ -216,4 +216,26 @@ public class ContractSignService {
}
}
return
response
;
return
response
;
}
}
/**
* 针对瓜分积分的模式
* @param ContractId
* @param uid
* @return
* @throws Exception
*/
public
Response
queryRewardStatus
(
String
ContractId
,
int
uid
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"contractId"
,
ContractId
);
logger
.
info
(
"请求queryRewardStatus接口,契约id="
+
ContractId
);
Response
response
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid
)).
params
(
map
).
get
(
activityHost
+
"/sign/contract/queryRewardStatus"
);
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/sign/contract/queryRewardStatus接口请求失败"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/sign/contract/queryRewardStatus接口失败,返回信息"
+
response
.
asString
());
}
catch
(
Error
er
)
{
throw
new
Exception
(
"/sign/contract/queryRewardStatus接口失败,返回信息"
+
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