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
c0c2b7ba
Commit
c0c2b7ba
authored
Nov 06, 2018
by
周松波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
604ffa95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
3 deletions
+44
-3
ContractSign_signTest.java
src/test/java/http/cases/SignTest/ContractSign_signTest.java
+44
-3
No files found.
src/test/java/http/cases/SignTest/ContractSign_signTest.java
View file @
c0c2b7ba
...
...
@@ -39,7 +39,7 @@ public class ContractSign_signTest extends DuibaTestBase {
ManagerService
managerService
;
@Value
(
"${activity.host}"
)
String
activityHost
;
String
period
;
// private static DuibaLog logger = DuibaLog.getLogger();
//指定用户
...
...
@@ -103,7 +103,7 @@ public class ContractSign_signTest extends DuibaTestBase {
// 期次开始的时间 yyyy-MM-dd格式
String
startTime
=
format
.
format
(
date
);
// 期次号 MMDD格式
String
period
=
format2
.
format
(
date
);
period
=
format2
.
format
(
date
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
6
);
date
=
calendar
.
getTime
();
// 期次结束时间
...
...
@@ -223,8 +223,49 @@ public class ContractSign_signTest extends DuibaTestBase {
//@Test(description = "开奖,活动ID=2",priority = 5)
public
void
契约开奖
()
throws
Exception
{
//修改redis的打卡日期键值
String
actId
=
"2"
;
Response
res
=
ContractSignService
.
getContracts
(
actId
,
uid2
);
String
issueId
=
res
.
jsonPath
().
getString
(
"data.list[0].issueId"
);
Date
now
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yy-MM-dd"
);
String
today
=
sdf
.
format
(
now
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
now
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
-
1
);
String
yestertoday
=
sdf
.
format
(
calendar
.
getTime
());
String
oldKey
=
String
.
format
(
"SIGNCENTER_K030_%s_%s"
,
issueId
,
today
);
String
newKey
=
String
.
format
(
"SIGNCENTER_k030_%s_%s"
,
issueId
,
yestertoday
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"key"
,
oldKey
);
map
.
put
(
"newKey"
,
newKey
);
Response
response
=
given
().
params
(
map
).
get
(
activityHost
+
"/signtest/redis/renameKey"
);
String
result
=
response
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
result
,
"true"
,
"重命名redis键值失败"
);
// 查询下期是否开始
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid3
);
homeInfoRes
.
prettyPrint
();
String
periodShow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.periodShow"
);
Assert
.
assertEquals
(
periodShow
,
period
,
"参与期次号不正确"
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"0"
,
"当前参与状态不正确"
);
// 查询中奖信息
Response
recordRes
=
ContractSignService
.
getContracts
(
actId
,
uid3
);
String
contractId
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].contractId"
);
String
doneStatus
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"WAIT_REWARD"
,
"当前期次完成状态不正确"
);
String
winCount
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].winCount"
);
Assert
.
assertEquals
(
winCount
,
"7000"
,
"瓜分奖励金额不正确"
);
// 领奖
Response
rewardRes
=
ContractSignService
.
getReward
(
contractId
,
uid3
);
String
rewardStatus
=
rewardRes
.
jsonPath
().
getString
(
"success"
);
String
rewardAmount
=
rewardRes
.
jsonPath
().
getString
(
"data"
);
Assert
.
assertEquals
(
rewardStatus
,
"true"
,
"领取奖励结果不正确"
);
Assert
.
assertEquals
(
rewardAmount
,
winCount
,
"领取奖励金额不正确"
);
}
public
Map
<
String
,
String
>
doJoinResult
(
String
activityId
,
String
betAmount
,
int
uid
)
throws
Exception
{
Response
doJoinRes
=
ContractSignService
.
doJoin
(
activityId
,
betAmount
,
uid
);
String
contractId
=
doJoinRes
.
jsonPath
().
getString
(
"data.contractId"
);
...
...
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