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
00a83fc8
Commit
00a83fc8
authored
Dec 03, 2018
by
马博
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into mabo
parents
8f50a69a
ba728f6f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
715 additions
and
46 deletions
+715
-46
ObjectExchange_ExchangeTest.java
.../http/cases/ExchangeTest/ObjectExchange_ExchangeTest.java
+1
-1
ContractSignCommon.java
src/test/java/http/cases/SignTest/ContractSignCommon.java
+233
-0
ContractSign_Multi_signTest.java
...java/http/cases/SignTest/ContractSign_Multi_signTest.java
+402
-0
ContractSign_signTest.java
src/test/java/http/cases/SignTest/ContractSign_signTest.java
+71
-41
补签测试_signTest.java
src/test/java/http/cases/SignTest/补签测试_signTest.java
+3
-0
种红包配置校验_AccessTest.java
src/test/java/http/cases/WalletTest/种红包配置校验_AccessTest.java
+4
-4
SignactivityService.java
src/test/java/http/service/Activity/SignactivityService.java
+1
-0
No files found.
src/test/java/http/cases/ExchangeTest/ObjectExchange_ExchangeTest.java
View file @
00a83fc8
...
@@ -47,9 +47,9 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
...
@@ -47,9 +47,9 @@ public class ObjectExchange_ExchangeTest extends CheckTemplet {
@BeforeClass
@BeforeClass
public
void
before
()
{
public
void
before
()
{
managerService
.
update
(
uid
,
"5555555"
);
// jdbc = MysqlUtils.mysqlDuiba("orders_consumer");
// jdbc = MysqlUtils.mysqlDuiba("orders_consumer");
try
{
try
{
managerService
.
update
(
uid
,
"5555555"
);
jdbc
.
update
(
"delete from orders_consumer.orders_0614 where consumer_id = 100011622 and biz_params = 'DUIBA_SELF'"
,
null
);
jdbc
.
update
(
"delete from orders_consumer.orders_0614 where consumer_id = 100011622 and biz_params = 'DUIBA_SELF'"
,
null
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
src/test/java/http/cases/SignTest/ContractSignCommon.java
0 → 100644
View file @
00a83fc8
package
http
.
cases
.
SignTest
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
base.MysqlConnPool
;
import
base.MysqlUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Activity.ManagerService
;
import
http.service.Activity.ContractSignService
;
import
http.service.Authorization
;
import
http.service.hd.SigninService
;
import
io.restassured.response.Response
;
import
org.apache.commons.lang.StringUtils
;
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.sql.SQLException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
static
io
.
restassured
.
RestAssured
.
given
;
@Service
public
class
ContractSignCommon
extends
DuibaTestBase
{
@Autowired
SigninService
signinService
;
@Autowired
Authorization
authorization
;
@Autowired
ContractSignService
ContractSignService
;
@Autowired
ManagerService
managerService
;
@Value
(
"${activity.host}"
)
String
activityHost
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
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"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"totalCount"
,
doJoinRes
.
jsonPath
().
getString
(
"data.betCount"
));
map
.
put
(
"buyers"
,
doJoinRes
.
jsonPath
().
getString
(
"data.buyers"
));
map
.
put
(
"cycle"
,
doJoinRes
.
jsonPath
().
getString
(
"data.contractCycle"
));
map
.
put
(
"contractId"
,
doJoinRes
.
jsonPath
().
getString
(
"data.contractId"
));
map
.
put
(
"issueId"
,
doJoinRes
.
jsonPath
().
getString
(
"data.issueId"
));
map
.
put
(
"startTime"
,
doJoinRes
.
jsonPath
().
getString
(
"data.startTime"
));
map
.
put
(
"endTime"
,
doJoinRes
.
jsonPath
().
getString
(
"data.endTime"
));
int
count
=
15
;
Response
betStatusRes
=
ContractSignService
.
betStatus
(
contractId
,
uid
);
map
.
put
(
"betCount"
,
betStatusRes
.
jsonPath
().
getString
(
"data.betCount"
));
String
status
=
"INIT"
;
String
statusDesc
=
""
;
while
(
count
>
0
&&
status
.
equals
(
"INIT"
)){
Thread
.
sleep
(
500
);
betStatusRes
=
ContractSignService
.
betStatus
(
contractId
,
uid
);
status
=
betStatusRes
.
jsonPath
().
getString
(
"data.doneStatus"
);
statusDesc
=
betStatusRes
.
jsonPath
().
getString
(
"data.doneStatusDesc"
);
count
--;
}
map
.
put
(
"doneStatus"
,
status
);
logger
.
info
(
"报名status:"
+
status
);
map
.
put
(
"doneStatusDesc"
,
statusDesc
);
return
map
;
}
public
void
clearIssue
(
String
consumerId
,
String
actId
,
MysqlConnPool
jdbc
){
try
{
Map
<
String
,
Object
>
result
=
jdbc
.
findSimpleResult
(
"select id, issue_id from credits_sign.tb_sign_contract_bet where consumer_id="
+
consumerId
+
" and act_id="
+
actId
);
if
(!
result
.
isEmpty
())
{
String
issueId
=
result
.
get
(
"issue_id"
).
toString
();
//String contractId = result.get("id").toString();
jdbc
.
update
(
"delete from credits_sign.tb_sign_contract_issue where id="
+
issueId
);
jdbc
.
update
(
"delete from credits_sign.tb_sign_contract_bet where issue_id="
+
issueId
);
jdbc
.
update
(
"delete from credits_sign.tb_sign_contract_log where issue_id="
+
issueId
);
}
}
catch
(
SQLException
e
){
logger
.
info
(
"数据库更新异常"
);
}
}
public
void
modifyJoinTime
(
String
actId
,
String
date
,
String
startTime
,
String
endTime
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
"自动化_报名截止时间"
);
map
.
put
(
"betCount"
,
"1000"
);
map
.
put
(
"bonusType"
,
"0"
);
map
.
put
(
"betType"
,
"2"
);
map
.
put
(
"bankerBonus"
,
"10000"
);
map
.
put
(
"ruleDesc:"
,
"<p>bao ming 截止时间</p>"
);
map
.
put
(
"contractCycle"
,
"7"
);
map
.
put
(
"joinTimeLimit"
,
false
);
map
.
put
(
"fakeLimit"
,
false
);
map
.
put
(
"rankPeriod"
,
"1"
);
map
.
put
(
"joinTimeStart"
,
startTime
);
map
.
put
(
"joinTimeEnd"
,
endTime
);
map
.
put
(
"joinDeadLine"
,
date
);
map
.
put
(
"actId"
,
actId
);
map
.
put
(
"openStatus"
,
true
);
map
.
put
(
"gradientAmountList"
,
""
);
map
.
put
(
"freeJoinLimit"
,
"0"
);
map
.
put
(
"enableAmpifyCard"
,
false
);
map
.
put
(
"openType"
,
"0"
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
Response
response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
body
(
jsonObject
).
post
(
"https://mng.duibatest.com.cn/newmanager/signContract/save"
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/signContract/save接口失败"
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"/signContract/save接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
)
{
throw
new
Exception
(
"/signContract/save接口失败,返回信息:"
+
response
.
asString
());
}
}
public
void
modifyIssuePeriod
(
String
issueId
,
int
num
)
throws
Exception
{
String
sql
=
"select start_time,end_time from credits_sign.tb_sign_contract_issue where id="
+
issueId
;
Map
<
String
,
Object
>
result
=
jdbc
.
findSimpleResult
(
sql
);
String
issueStartTime
=
result
.
get
(
"start_time"
).
toString
();
String
issueEndTime
=
result
.
get
(
"end_time"
).
toString
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
//SimpleDateFormat sdf2 = new SimpleDateFormat("MM-dd");
try
{
Date
startDate
=
sdf
.
parse
(
issueStartTime
);
Date
endDate
=
sdf
.
parse
(
issueEndTime
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
startDate
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
num
);
String
startTime
=
sdf
.
format
(
calendar
.
getTime
());
calendar
.
setTime
(
endDate
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
num
);
String
endTime
=
sdf
.
format
(
calendar
.
getTime
());
String
sql2
=
"update credits_sign.tb_sign_contract_issue set start_time='"
+
startTime
+
"', end_time='"
+
endTime
+
"' where id="
+
issueId
;
try
{
jdbc
.
update
(
sql2
);
}
catch
(
SQLException
e
)
{
logger
.
info
(
"数据库更新异常"
);
}
}
catch
(
ParseException
px
)
{
px
.
printStackTrace
();
}
}
/**
* 补签今日之前的日期
* @param actId
* @param uid
* @param num 当前所在周期内第几天
* @param isBlock 不补签昨天
* @throws Exception
*/
public
void
contractResign
(
String
actId
,
int
uid
,
int
num
,
boolean
isBlock
)
throws
Exception
{
//查询issueId,contractId
Response
res
=
ContractSignService
.
getContracts
(
actId
,
uid
);
// 接口返回的第一条信息为最近参与的记录
String
issueId
=
res
.
jsonPath
().
getString
(
"data.list[0].issueId"
);
String
contractId
=
res
.
jsonPath
().
getString
(
"data.list[0].contractId"
);
if
(
StringUtils
.
isNotBlank
(
issueId
)
&&
StringUtils
.
isNotBlank
(
contractId
))
{
// 查询签到历史记录
String
queryLog
=
"select sign_date from credits_sign.tb_sign_contract_log where contract_id="
+
contractId
;
List
<
Map
<
String
,
Object
>>
result
=
jdbc
.
findModeResult
(
queryLog
);
String
signedDate
;
List
<
String
>
dateList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
result
.
size
();
i
++)
{
signedDate
=
result
.
get
(
i
).
get
(
"sign_date"
).
toString
();
dateList
.
add
(
signedDate
);
}
String
queryBet
=
"select consumer_id from credits_sign.tb_sign_contract_bet where id="
+
contractId
;
Map
<
String
,
Object
>
betResult
=
jdbc
.
findSimpleResult
(
queryBet
);
String
consumerId
=
betResult
.
get
(
"consumer_id"
).
toString
();
// 查询期次开始时间
String
queryPeriod
=
"select start_time, end_time, contract_cycle, winners from credits_sign.tb_sign_contract_issue where id="
+
issueId
;
Map
<
String
,
Object
>
issueResult
=
jdbc
.
findSimpleResult
(
queryPeriod
);
String
startDate
=
issueResult
.
get
(
"start_time"
).
toString
();
String
endDate
=
issueResult
.
get
(
"end_time"
).
toString
();
int
cycle
=
Integer
.
valueOf
(
issueResult
.
get
(
"contract_cycle"
).
toString
());
String
winners
=
issueResult
.
get
(
"winners"
).
toString
();
//需要打卡的日期
int
period
=
num
;
int
flag
=
0
;
if
(
num
>
cycle
)
{
period
=
cycle
+
1
;
}
if
(
isBlock
&&
result
.
size
()
==
0
)
{
flag
=
1
;
}
List
<
String
>
signDateList
=
new
ArrayList
<>();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Date
startTime
=
sdf
.
parse
(
startDate
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
startTime
);
String
signDate
;
for
(
int
i
=
1
;
i
<
period
-
flag
;
i
++)
{
signDate
=
sdf
.
format
(
calendar
.
getTime
());
if
(!
dateList
.
contains
(
signDate
))
{
signDateList
.
add
(
signDate
);
}
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
1
);
}
String
updateBet
;
String
updateLog
;
if
(
num
<=
cycle
)
{
updateBet
=
"update credits_sign.tb_sign_contract_bet set done_days="
+
String
.
valueOf
(
num
-
1
-
flag
)
+
" where id="
+
contractId
;
try
{
jdbc
.
update
(
updateBet
);
if
(
signDateList
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
signDateList
.
size
();
i
++)
{
updateLog
=
String
.
format
(
"INSERT INTO credits_sign.tb_sign_contract_log(consumer_id, contract_id, act_id, issue_id, sign_date) VALUES (%s, %s, %s, %s, \'%s\')"
,
consumerId
,
contractId
,
actId
,
issueId
,
signDateList
.
get
(
i
));
jdbc
.
update
(
updateLog
);
logger
.
info
(
"补签成功"
);
}
}
}
catch
(
SQLException
e
)
{
logger
.
info
(
"数据库更新异常"
);
}
}
}
else
{
logger
.
info
(
"未执行补签"
);
}
}
}
src/test/java/http/cases/SignTest/ContractSign_Multi_signTest.java
0 → 100644
View file @
00a83fc8
package
http
.
cases
.
SignTest
;
import
base.DuibaTestBase
;
import
http.service.Activity.ManagerService
;
import
http.service.Authorization
;
import
http.service.hd.SigninService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.testng.Assert
;
import
org.testng.annotations.Test
;
import
io.restassured.response.Response
;
import
java.net.SocketImpl
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.ExecutionException
;
import
utils.RedisUtil
;
import
static
io
.
restassured
.
RestAssured
.
given
;
public
class
ContractSign_Multi_signTest
extends
DuibaTestBase
{
@Autowired
ContractSignCommon
ContractSignCommon
;
@Autowired
SigninService
signinService
;
@Autowired
Authorization
authorization
;
@Autowired
http
.
service
.
Activity
.
ContractSignService
ContractSignService
;
@Autowired
ManagerService
managerService
;
@Value
(
"${activity.host}"
)
String
activityHost
;
private
static
int
uid1
,
uid2
,
uid3
,
uid4
,
uid5
,
uid6
;
static
{
uid1
=
4628
;
//100104096;
uid2
=
4629
;
//100104097
uid3
=
4630
;
//100104098
uid4
=
4631
;
//100104099
uid5
=
4632
;
//100104101
uid6
=
4633
;
//100104100
}
private
static
String
actId
,
betAmount1
,
betAmount2
,
betAmount3
;
static
{
actId
=
"5"
;
betAmount1
=
"1000"
;
betAmount2
=
"500"
;
betAmount3
=
"100"
;
}
private
String
issueId
;
private
String
period
;
private
String
contractId1
,
contractId2
,
contractId3
,
contractId4
,
contractId5
,
contractId6
;
//@Test(description = "契约签到多梯度报名,活动id=5",priority = 1)
public
void
多梯度报名
()
throws
Exception
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format2
=
new
SimpleDateFormat
(
"MMdd"
);
Date
date
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
1
);
date
=
calendar
.
getTime
();
// 期次开始的时间 yyyy-MM-dd格式
String
startTime
=
format
.
format
(
date
);
// 期次号 MMDD格式
period
=
format2
.
format
(
date
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
6
);
date
=
calendar
.
getTime
();
// 期次结束时间
String
endTime
=
format
.
format
(
date
);
// uid1 uid2 报名梯度1
Map
<
String
,
String
>
map1
=
ContractSignCommon
.
doJoinResult
(
actId
,
betAmount1
,
uid1
);
issueId
=
map1
.
get
(
"issueId"
);
String
doneStatus
=
map1
.
get
(
"doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"DOING"
,
"uid1报名失败:"
+
doneStatus
);
Map
<
String
,
String
>
map2
=
ContractSignCommon
.
doJoinResult
(
actId
,
betAmount1
,
uid2
);
doneStatus
=
map2
.
get
(
"doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"DOING"
,
"uid2报名失败:"
+
doneStatus
);
// uid3 uid4 报名梯度2
Map
<
String
,
String
>
map3
=
ContractSignCommon
.
doJoinResult
(
actId
,
betAmount2
,
uid3
);
doneStatus
=
map3
.
get
(
"doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"DOING"
,
"uid3报名失败:"
+
doneStatus
);
Map
<
String
,
String
>
map4
=
ContractSignCommon
.
doJoinResult
(
actId
,
betAmount2
,
uid4
);
doneStatus
=
map4
.
get
(
"doneStatusDesc"
);
Assert
.
assertEquals
(
doneStatus
,
"DOING"
,
"uid4报名失败:"
+
doneStatus
);
//uid5 uid6 报名梯度3
Map
<
String
,
String
>
map5
=
ContractSignCommon
.
doJoinResult
(
actId
,
betAmount3
,
uid5
);
doneStatus
=
map5
.
get
(
"doneStatusDesc"
);
Assert
.
assertEquals
(
doneStatus
,
"DOING"
,
"uid5报名失败:"
+
doneStatus
);
Map
<
String
,
String
>
map6
=
ContractSignCommon
.
doJoinResult
(
actId
,
betAmount3
,
uid6
);
doneStatus
=
map6
.
get
(
"doneStatusDesc"
);
Assert
.
assertEquals
(
doneStatus
,
"DOING"
,
"uid6报名失败:"
+
doneStatus
);
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid1
);
homeInfoRes
.
prettyPrint
();
String
betCount
=
homeInfoRes
.
jsonPath
().
getString
(
"data.betCount"
);
Assert
.
assertEquals
(
betCount
,
betAmount1
,
"uid1报名额度显示不正确"
);
int
buyers
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.buyers"
);
Assert
.
assertEquals
(
buyers
,
6
,
"报名后的总人数不正确"
);
String
periodShow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.periodShow"
);
Assert
.
assertEquals
(
periodShow
,
period
,
"参与期次号不正确"
);
String
currentPeriod
=
homeInfoRes
.
jsonPath
().
getString
(
"data.currentPeriod"
);
Assert
.
assertEquals
(
currentPeriod
,
"0"
,
"当前期次进度不正确"
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"2"
,
"当前参与状态不正确"
);
String
bankerBonus
=
homeInfoRes
.
jsonPath
().
getString
(
"data.bankerBonus"
);
Assert
.
assertEquals
(
bankerBonus
,
"10000"
,
"保底奖池数量不正确"
);
int
totalCount
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.betTotalCount"
);
Assert
.
assertEquals
(
totalCount
,
13200
,
"报名后总奖池数量不正确"
);
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid3
);
betCount
=
homeInfoRes
.
jsonPath
().
getString
(
"data.betCount"
);
Assert
.
assertEquals
(
betCount
,
betAmount2
,
"uid3报名额度显示不正确"
);
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid5
);
betCount
=
homeInfoRes
.
jsonPath
().
getString
(
"data.betCount"
);
Assert
.
assertEquals
(
betCount
,
betAmount3
,
"uid5报名额度显示不正确"
);
}
//@Test(description = "多梯度签到,uid1,uid3,uid5, 活动ID=5", priority = 2)
public
void
多梯度签到
()
throws
Exception
{
//修改期次,今日为打卡第一天
ContractSignCommon
.
modifyIssuePeriod
(
issueId
,
-
1
);
Date
now
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"MMdd"
);
SimpleDateFormat
sdf2
=
new
SimpleDateFormat
(
"yy-MM-dd"
);
period
=
sdf
.
format
(
now
);
String
today
=
sdf2
.
format
(
now
);
// uid1打卡前请求homeInfo接口
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid1
);
String
currentPeriod
=
homeInfoRes
.
jsonPath
().
getString
(
"data.currentPeriod"
);
Assert
.
assertEquals
(
currentPeriod
,
"1"
,
"当前非打卡第一天"
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"3"
,
"未打卡前打卡状态不正确"
);
String
periodShow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.periodShow"
);
Assert
.
assertEquals
(
periodShow
,
period
,
"期次号不正确"
);
int
rewardRatio
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.currentIssueRewardRatio"
);
Assert
.
assertEquals
(
rewardRatio
,
1320
,
"未打卡前瓜分比例不正确"
);
//uid1打卡
Response
signRes
=
ContractSignService
.
doSign
(
"2"
,
uid1
);
String
success
=
signRes
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"打卡失败"
);
//查询redis打卡金额
String
K030
=
String
.
format
(
"SIGNCENTER_K030_%s_%s"
,
issueId
,
today
);
int
value
=
Integer
.
valueOf
(
RedisUtil
.
getKey
(
K030
));
Assert
.
assertEquals
(
value
,
1000
,
"当前打卡奖池总额不正确"
);
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid1
);
rewardRatio
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.currentIssueRewardRatio"
);
Assert
.
assertEquals
(
rewardRatio
,
1320
,
"未打卡前瓜分比例不正确"
);
String
daySuccCount
=
homeInfoRes
.
jsonPath
().
getString
(
"data.daySuccCount"
);
Assert
.
assertEquals
(
daySuccCount
,
"1"
,
"打卡后,打卡成功人数不正确"
);
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"4"
,
"打卡完成后状态不正确"
);
// uid3打卡前请求homeInfo接口
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid3
);
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"3"
,
"未打卡前打卡状态不正确"
);
rewardRatio
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.currentIssueRewardRatio"
);
Assert
.
assertEquals
(
rewardRatio
,
880
,
"打卡后瓜分比例不正确"
);
//uid3打卡
signRes
=
ContractSignService
.
doSign
(
"2"
,
uid3
);
success
=
signRes
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"打卡失败"
);
value
=
Integer
.
valueOf
(
RedisUtil
.
getKey
(
K030
));
Assert
.
assertEquals
(
value
,
1500
,
"当前打卡奖池总额不正确"
);
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid3
);
rewardRatio
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.currentIssueRewardRatio"
);
Assert
.
assertEquals
(
rewardRatio
,
880
,
"打卡后前瓜分比例不正确"
);
daySuccCount
=
homeInfoRes
.
jsonPath
().
getString
(
"data.daySuccCount"
);
Assert
.
assertEquals
(
daySuccCount
,
"2"
,
"打卡后,打卡成功人数不正确"
);
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"4"
,
"打卡完成后状态不正确"
);
// uid5打卡前请求homeInfo接口
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid5
);
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"3"
,
"未打卡前打卡状态不正确"
);
rewardRatio
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.currentIssueRewardRatio"
);
Assert
.
assertEquals
(
rewardRatio
,
825
,
"打卡后瓜分比例不正确"
);
//uid5打卡
signRes
=
ContractSignService
.
doSign
(
"2"
,
uid5
);
success
=
signRes
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"打卡失败"
);
value
=
Integer
.
valueOf
(
RedisUtil
.
getKey
(
K030
));
Assert
.
assertEquals
(
value
,
1600
,
"当前打卡奖池总额不正确"
);
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid5
);
rewardRatio
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.currentIssueRewardRatio"
);
Assert
.
assertEquals
(
rewardRatio
,
825
,
"打卡后前瓜分比例不正确"
);
daySuccCount
=
homeInfoRes
.
jsonPath
().
getString
(
"data.daySuccCount"
);
Assert
.
assertEquals
(
daySuccCount
,
"3"
,
"打卡后,打卡成功人数不正确"
);
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"4"
,
"打卡完成后状态不正确"
);
}
//@Test(description = "多梯度完成打卡",priority = 3)
public
void
多梯度完成打卡
()
throws
Exception
{
//修改期次,周期再往前移6天
ContractSignCommon
.
modifyIssuePeriod
(
actId
,
-
6
);
//补签前6天
ContractSignCommon
.
contractResign
(
actId
,
uid2
,
7
,
false
);
ContractSignCommon
.
contractResign
(
actId
,
uid4
,
7
,
false
);
ContractSignCommon
.
contractResign
(
actId
,
uid6
,
7
,
false
);
//今日打卡
Response
signRes
=
ContractSignService
.
doSign
(
actId
,
uid2
);
String
success
=
signRes
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"uid2第7日打卡失败"
);
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid2
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"6"
,
"完成7日打卡状态不正确"
);
String
hasReward
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasReward"
);
String
hasRewardTomorrow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasRewardTomorrow"
);
Assert
.
assertEquals
(
hasReward
,
"false"
,
"uid2是否有奖励状态不正确"
);
Assert
.
assertEquals
(
hasRewardTomorrow
,
"true"
,
"uid2明日是否有奖励状态不正确"
);
Response
recordRes
=
ContractSignService
.
getContracts
(
actId
,
uid2
);
String
doneStatus
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"DONE"
,
"uid2参与记录中完成状态不正确"
);
signRes
=
ContractSignService
.
doSign
(
actId
,
uid4
);
success
=
signRes
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"uid4第7日打卡失败"
);
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid4
);
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"6"
,
"完成7日打卡状态不正确"
);
hasReward
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasReward"
);
hasRewardTomorrow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasRewardTomorrow"
);
Assert
.
assertEquals
(
hasReward
,
"false"
,
"uid4是否有奖励状态不正确"
);
Assert
.
assertEquals
(
hasRewardTomorrow
,
"true"
,
"uid4明日是否有奖励状态不正确"
);
recordRes
=
ContractSignService
.
getContracts
(
actId
,
uid2
);
doneStatus
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"DONE"
,
"uid4参与记录中完成状态不正确"
);
signRes
=
ContractSignService
.
doSign
(
actId
,
uid6
);
success
=
signRes
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"uid6第7日打卡失败"
);
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid6
);
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"6"
,
"完成7日打卡状态不正确"
);
hasReward
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasReward"
);
hasRewardTomorrow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasRewardTomorrow"
);
Assert
.
assertEquals
(
hasReward
,
"false"
,
"uid6是否有奖励状态不正确"
);
Assert
.
assertEquals
(
hasRewardTomorrow
,
"true"
,
"uid6明日是否有奖励状态不正确"
);
recordRes
=
ContractSignService
.
getContracts
(
actId
,
uid2
);
doneStatus
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"DONE"
,
"uid6参与记录中完成状态不正确"
);
int
daySuccCount
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.daySuccCount"
);
Assert
.
assertEquals
(
daySuccCount
,
3
,
"第7日打卡完成人数不正确"
);
int
currentPeriod
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.currentPeriod"
);
Assert
.
assertEquals
(
currentPeriod
,
7
,
"当前期次进度天数不正确"
);
}
//@Test(description = "开奖", priority = 4)
public
void
多梯度开奖
()
throws
Exception
{
ContractSignCommon
.
modifyIssuePeriod
(
issueId
,
-
1
);
//修改redis的打卡日期键值
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
,
uid2
);
String
periodShow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.periodShow"
);
Assert
.
assertEquals
(
periodShow
,
period
,
"参与期次号不正确"
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"6"
,
"当前参与状态不正确"
);
String
hasReward
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasReward"
);
Assert
.
assertEquals
(
hasReward
,
"true"
,
"今日是否有奖励状态不正确"
);
//查询uid2参与记录
Response
recordRes
=
ContractSignService
.
getContracts
(
actId
,
uid2
);
contractId2
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].contractId"
);
String
doneStatus
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"WAIT_REWARD"
,
"uid2当前期次完成状态不正确"
);
String
winCount
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].winCount"
);
Assert
.
assertEquals
(
winCount
,
"8250"
,
"uid2瓜分奖励金额不正确"
);
//查询uid4参与记录
recordRes
=
ContractSignService
.
getContracts
(
actId
,
uid4
);
contractId4
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].contractId"
);
doneStatus
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"WAIT_REWARD"
,
"uid4当前期次完成状态不正确"
);
winCount
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].winCount"
);
Assert
.
assertEquals
(
winCount
,
"4125"
,
"uid4瓜分奖励金额不正确"
);
//查询uid6参与记录
recordRes
=
ContractSignService
.
getContracts
(
actId
,
uid6
);
contractId6
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].contractId"
);
doneStatus
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].doneStatus"
);
Assert
.
assertEquals
(
doneStatus
,
"WAIT_REWARD"
,
"uid6当前期次完成状态不正确"
);
winCount
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].winCount"
);
Assert
.
assertEquals
(
winCount
,
"825"
,
"uid6瓜分奖励金额不正确"
);
}
//@Test(description = "多梯度断签",priority = 5)
public
void
多梯度断签
()
throws
Exception
{
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid1
);
String
periodShow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.periodShow"
);
Assert
.
assertEquals
(
periodShow
,
period
,
"参与期次号不正确"
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"4"
,
"当前参与状态不正确"
);
String
hasReward
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasReward"
);
Assert
.
assertEquals
(
hasReward
,
"false"
,
"今日是否有奖励状态不正确"
);
Date
now
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"MM-dd"
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
now
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
-
7
);
String
startTime
=
sdf
.
format
(
calendar
.
getTime
());
String
failDate
=
homeInfoRes
.
jsonPath
().
getString
(
"data.failDate"
);
// todo del
logger
.
info
(
failDate
);
Assert
.
assertEquals
(
failDate
,
startTime
,
"uid1断签日期不正确"
);
}
//@Test(description = "多梯度领奖",priority = 6)
public
void
多梯度领奖
()
throws
Exception
{
//uid2领奖
Response
rewardRes
=
ContractSignService
.
getReward
(
contractId2
,
uid2
);
int
rewardCount
=
rewardRes
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertEquals
(
rewardCount
,
8250
,
"uid2领取奖励数不正确"
);
// uid4领奖
rewardRes
=
ContractSignService
.
getReward
(
contractId4
,
uid4
);
rewardCount
=
rewardRes
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertEquals
(
rewardCount
,
4125
,
"uid4领取奖励数不正确"
);
// uid6领奖
rewardRes
=
ContractSignService
.
getReward
(
contractId6
,
uid6
);
rewardCount
=
rewardRes
.
jsonPath
().
getInt
(
"data"
);
Assert
.
assertEquals
(
rewardCount
,
825
,
"uid6领取奖励数不正确"
);
//断签用户uid1领奖
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"contractId"
,
contractId1
);
rewardRes
=
given
().
cookies
(
authorization
.
dafuwengLogin
(
uid1
)).
params
(
map
).
post
(
activityHost
+
"/sign/contract/getReward"
);
String
success
=
rewardRes
.
jsonPath
().
getString
(
"success"
);
String
desc
=
rewardRes
.
jsonPath
().
getString
(
"desc"
);
Assert
.
assertEquals
(
success
,
"false"
,
"uid1领取结果不正确"
);
Assert
.
assertEquals
(
desc
,
"领奖处理失败"
,
"uid1领取描述不正确"
);
}
//@Test(description = "多梯度中奖轮播",priority = 7)
public
void
多梯度中奖轮播
()
throws
Exception
{
//删除redis key
String
carouselKey
=
String
.
format
(
"SIGNCENTER_K034_%s_%s"
,
actId
,
issueId
);
Map
<
String
,
String
>
keyMap
=
new
HashMap
<>();
keyMap
.
put
(
"key"
,
carouselKey
);
Response
redisResponse
=
given
().
params
(
keyMap
).
get
(
activityHost
+
"/signtest/redis/delKey"
);
String
redisResult
=
redisResponse
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
redisResult
,
"true"
,
"删除redis键值失败"
);
Response
CarouselRes
=
ContractSignService
.
getRewardTodayLimit200
(
actId
,
uid2
);
String
cid2
=
CarouselRes
.
jsonPath
().
getString
(
"data[0].consumerId"
);
String
partnerUserId2
=
CarouselRes
.
jsonPath
().
getString
(
"data[0].uid"
);
String
nickname2
=
CarouselRes
.
jsonPath
().
getString
(
"data[0].nickName"
);
String
winCount2
=
CarouselRes
.
jsonPath
().
getString
(
"data[0].winCount"
);
Assert
.
assertEquals
(
cid2
,
"100104097"
);
Assert
.
assertEquals
(
partnerUserId2
,
String
.
valueOf
(
uid2
));
Assert
.
assertEquals
(
nickname2
,
"Auto4629"
);
Assert
.
assertEquals
(
winCount2
,
"8250"
);
CarouselRes
=
ContractSignService
.
getRewardTodayLimit200
(
actId
,
uid4
);
String
cid4
=
CarouselRes
.
jsonPath
().
getString
(
"data[1].consumerId"
);
String
partnerUserId4
=
CarouselRes
.
jsonPath
().
getString
(
"data[1].uid"
);
String
nickname4
=
CarouselRes
.
jsonPath
().
getString
(
"data[1].nickName"
);
String
winCount4
=
CarouselRes
.
jsonPath
().
getString
(
"data[1].winCount"
);
Assert
.
assertEquals
(
cid4
,
"100104099"
);
Assert
.
assertEquals
(
partnerUserId4
,
String
.
valueOf
(
uid4
));
Assert
.
assertEquals
(
nickname4
,
"Auto4631"
);
Assert
.
assertEquals
(
winCount4
,
"4125"
);
CarouselRes
=
ContractSignService
.
getRewardTodayLimit200
(
actId
,
uid6
);
String
cid6
=
CarouselRes
.
jsonPath
().
getString
(
"data[2].consumerId"
);
String
partnerUserId6
=
CarouselRes
.
jsonPath
().
getString
(
"data[2].uid"
);
String
nickname6
=
CarouselRes
.
jsonPath
().
getString
(
"data[2].nickName"
);
String
winCount6
=
CarouselRes
.
jsonPath
().
getString
(
"data[2].winCount"
);
Assert
.
assertEquals
(
cid6
,
"100104100"
);
Assert
.
assertEquals
(
partnerUserId6
,
String
.
valueOf
(
uid6
));
Assert
.
assertEquals
(
nickname6
,
"Auto4633"
);
Assert
.
assertEquals
(
winCount6
,
"825"
);
}
}
src/test/java/http/cases/SignTest/ContractSign_signTest.java
View file @
00a83fc8
...
@@ -74,7 +74,6 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -74,7 +74,6 @@ public class ContractSign_signTest extends DuibaTestBase {
String
success
=
doJoinRes
.
jsonPath
().
getString
(
"success"
);
String
success
=
doJoinRes
.
jsonPath
().
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"false"
,
"报名成功状态不正确"
);
Assert
.
assertEquals
(
success
,
"false"
,
"报名成功状态不正确"
);
Assert
.
assertEquals
(
code
,
"200001"
,
"报名失败的错误码不正确"
);
Assert
.
assertEquals
(
code
,
"200001"
,
"报名失败的错误码不正确"
);
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
"3"
,
uid1
);
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
"3"
,
uid1
);
String
suspend
=
homeInfoRes
.
jsonPath
().
getString
(
"data.suspend"
);
String
suspend
=
homeInfoRes
.
jsonPath
().
getString
(
"data.suspend"
);
Assert
.
assertEquals
(
suspend
,
"true"
,
"活动报名截止状态不正确"
);
Assert
.
assertEquals
(
suspend
,
"true"
,
"活动报名截止状态不正确"
);
...
@@ -92,12 +91,39 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -92,12 +91,39 @@ public class ContractSign_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
deadLine
,
"2018-01-01 14:00:00.0"
,
"设置报名截止时间失败"
);
Assert
.
assertEquals
(
deadLine
,
"2018-01-01 14:00:00.0"
,
"设置报名截止时间失败"
);
}
}
@Test
(
description
=
"契约签到报名测试, 活动ID=2"
,
priority
=
1
)
@Test
(
description
=
"签到信息查询,活动ID=2"
,
priority
=
1
)
public
void
契约签到报名
()
throws
Exception
{
public
void
签到活动信息
()
throws
Exception
{
String
actId
=
"2"
;
String
betAmount
=
"1000"
;
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"MMdd"
);
Date
date
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
1
);
date
=
calendar
.
getTime
();
// 期次号 MMDD格式
period
=
format
.
format
(
date
);
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid1
);
int
contractCycle
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.contractCycle"
);
Assert
.
assertEquals
(
contractCycle
,
7
,
"周期天数不正确"
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"0"
,
"当前参与状态不正确"
);
String
bankerBonus
=
homeInfoRes
.
jsonPath
().
getString
(
"data.bankerBonus"
);
Assert
.
assertEquals
(
bankerBonus
,
"10000"
,
"保底奖池数量不正确"
);
String
betCount
=
homeInfoRes
.
jsonPath
().
getString
(
"data.betCount"
);
Assert
.
assertEquals
(
betCount
,
betAmount
,
"报名的额度不正确"
);
int
buyers
=
homeInfoRes
.
jsonPath
().
getInt
(
"data.buyers"
);
Assert
.
assertEquals
(
buyers
,
0
,
"报名人数不正确"
);
String
periodShow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.periodShow"
);
Assert
.
assertEquals
(
periodShow
,
period
,
"活动期次号不正确"
);
}
@Test
(
description
=
"契约签到报名测试, 活动ID=2"
,
priority
=
2
)
public
void
固定额度报名
()
throws
Exception
{
String
actId
=
"2"
;
String
actId
=
"2"
;
String
betAmount
=
"1000"
;
String
betAmount
=
"1000"
;
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
SimpleDateFormat
format2
=
new
SimpleDateFormat
(
"MMdd"
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
calendar
.
setTime
(
date
);
...
@@ -105,8 +131,6 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -105,8 +131,6 @@ public class ContractSign_signTest extends DuibaTestBase {
date
=
calendar
.
getTime
();
date
=
calendar
.
getTime
();
// 期次开始的时间 yyyy-MM-dd格式
// 期次开始的时间 yyyy-MM-dd格式
String
startTime
=
format
.
format
(
date
);
String
startTime
=
format
.
format
(
date
);
// 期次号 MMDD格式
period
=
format2
.
format
(
date
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
6
);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
6
);
date
=
calendar
.
getTime
();
date
=
calendar
.
getTime
();
// 期次结束时间
// 期次结束时间
...
@@ -130,7 +154,7 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -130,7 +154,7 @@ public class ContractSign_signTest extends DuibaTestBase {
map
=
this
.
doJoinResult
(
actId
,
betAmount
,
uid4
);
map
=
this
.
doJoinResult
(
actId
,
betAmount
,
uid4
);
Assert
.
assertEquals
(
map
.
get
(
"doneStatus"
),
"DOING"
,
String
.
format
(
"%d join failed, %s"
,
uid4
,
doneStatusDesc
));
Assert
.
assertEquals
(
map
.
get
(
"doneStatus"
),
"DOING"
,
String
.
format
(
"%d join failed, %s"
,
uid4
,
doneStatusDesc
));
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid1
);
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid1
);
homeInfoRes
.
prettyPrint
();
//
homeInfoRes.prettyPrint();
// String joinTimeLimit = homeInfoRes.jsonPath().getString("data.joinTimeLimit");
// String joinTimeLimit = homeInfoRes.jsonPath().getString("data.joinTimeLimit");
// Assert.assertEquals(joinTimeLimit,"true", "参与时间限制校验失败");
// Assert.assertEquals(joinTimeLimit,"true", "参与时间限制校验失败");
String
betCount
=
homeInfoRes
.
jsonPath
().
getString
(
"data.betCount"
);
String
betCount
=
homeInfoRes
.
jsonPath
().
getString
(
"data.betCount"
);
...
@@ -144,14 +168,13 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -144,14 +168,13 @@ public class ContractSign_signTest extends DuibaTestBase {
//0-未报名 1-报名中 2-已报名,打卡未开始 3-未打卡:打卡开始,当天未打卡 4-已打卡:当天已打卡(非最后一天) 5-失败:出现断卡(未报名新一期) 6-成功: 已成功(未报名新一期)
//0-未报名 1-报名中 2-已报名,打卡未开始 3-未打卡:打卡开始,当天未打卡 4-已打卡:当天已打卡(非最后一天) 5-失败:出现断卡(未报名新一期) 6-成功: 已成功(未报名新一期)
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"2"
,
"当前参与状态不正确"
);
Assert
.
assertEquals
(
status
,
"2"
,
"当前参与状态不正确"
);
String
bankerBonus
=
homeInfoRes
.
jsonPath
().
getString
(
"data.bankerBonus"
);
Assert
.
assertEquals
(
bankerBonus
,
"10000"
,
"保底奖池数量不正确"
);
int
totalCount_new
=
Integer
.
valueOf
(
homeInfoRes
.
jsonPath
().
getString
(
"data.betTotalCount"
));
int
totalCount_new
=
Integer
.
valueOf
(
homeInfoRes
.
jsonPath
().
getString
(
"data.betTotalCount"
));
Assert
.
assertEquals
(
totalCount_new
,
10000
+
Integer
.
valueOf
(
betAmount
)*
4
,
"报名后奖池数量不正确"
);
Assert
.
assertEquals
(
totalCount_new
,
10000
+
Integer
.
valueOf
(
betAmount
)*
4
,
"报名后奖池数量不正确"
);
}
}
@Test
(
description
=
"活动ID=2, uid1打卡"
,
priority
=
2
)
@Test
(
description
=
"活动ID=2, uid1打卡"
,
priority
=
3
)
public
void
签到打卡
()
throws
Exception
{
public
void
固定额度
签到打卡
()
throws
Exception
{
String
actId
=
"2"
;
String
actId
=
"2"
;
//修改期次,今日为打卡日
//修改期次,今日为打卡日
modifyIssuePeriod
(
issueId
,-
1
);
modifyIssuePeriod
(
issueId
,-
1
);
...
@@ -178,8 +201,8 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -178,8 +201,8 @@ public class ContractSign_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
status
,
"4"
,
"打卡完成后状态不正确"
);
Assert
.
assertEquals
(
status
,
"4"
,
"打卡完成后状态不正确"
);
}
}
@Test
(
description
=
"活动ID=2,uid2第六天断签"
,
priority
=
3
)
@Test
(
description
=
"活动ID=2,uid2第六天断签"
,
priority
=
4
)
public
void
契约签到
断签
()
throws
Exception
{
public
void
固定额度
断签
()
throws
Exception
{
String
actId
=
"2"
;
String
actId
=
"2"
;
//当天为周期第一天,周期往前再挪6天
//当天为周期第一天,周期往前再挪6天
modifyIssuePeriod
(
issueId
,-
6
);
modifyIssuePeriod
(
issueId
,-
6
);
...
@@ -200,8 +223,8 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -200,8 +223,8 @@ public class ContractSign_signTest extends DuibaTestBase {
}
}
@Test
(
description
=
"uid3 uid4打卡完成,活动ID=2"
,
priority
=
4
)
@Test
(
description
=
"uid3 uid4打卡完成,活动ID=2"
,
priority
=
5
)
public
void
契约签到
整期打卡完成
()
throws
Exception
{
public
void
固定额度
_
整期打卡完成
()
throws
Exception
{
String
actId
=
"2"
;
String
actId
=
"2"
;
//补签前6天
//补签前6天
this
.
contractResign
(
actId
,
uid3
,
7
,
false
);
this
.
contractResign
(
actId
,
uid3
,
7
,
false
);
...
@@ -217,34 +240,39 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -217,34 +240,39 @@ public class ContractSign_signTest extends DuibaTestBase {
logger
.
info
(
"uid3七日打卡成功"
);
logger
.
info
(
"uid3七日打卡成功"
);
signRes
=
ContractSignService
.
doSign
(
"2"
,
uid4
);
signRes
=
ContractSignService
.
doSign
(
"2"
,
uid4
);
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid3
);
success
=
signRes
.
jsonPath
().
getString
(
"success"
);
success
=
signRes
.
jsonPath
().
getString
(
"success"
);
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
success
,
"true"
,
"uid4打卡失败"
);
Assert
.
assertEquals
(
success
,
"true"
,
"uid4打卡失败"
);
Assert
.
assertEquals
(
status
,
"6"
,
"完成7日打卡状态不正确"
);
logger
.
info
(
"uid4七日打卡成功"
);
logger
.
info
(
"uid4七日打卡成功"
);
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid3
);
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"6"
,
"完成7日打卡状态不正确"
);
String
hasReward
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasReward"
);
String
hasRewardTomorrow
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasRewardTomorrow"
);
Assert
.
assertEquals
(
hasReward
,
"false"
,
"是否有带领取奖励不正确"
);
Assert
.
assertEquals
(
hasRewardTomorrow
,
"true"
,
"明日是否有奖励状态不正确"
);
}
}
@Test
(
description
=
"开奖,活动ID=2"
,
priority
=
5
)
@Test
(
description
=
"开奖,活动ID=2"
,
priority
=
6
)
public
void
契约开奖
()
throws
Exception
{
public
void
契约开奖
_
固定额度
()
throws
Exception
{
modifyIssuePeriod
(
issueId
,
-
1
);
modifyIssuePeriod
(
issueId
,
-
1
);
//修改redis的打卡日期键值
//修改redis的打卡日期键值
String
actId
=
"2"
;
String
actId
=
"2"
;
Date
now
=
new
Date
();
//
Date now = new Date();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yy-MM-dd"
);
//
SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd");
String
today
=
sdf
.
format
(
now
);
//
String today = sdf.format(now);
Calendar
calendar
=
Calendar
.
getInstance
();
//
Calendar calendar = Calendar.getInstance();
calendar
.
setTime
(
now
);
//
calendar.setTime(now);
calendar
.
add
(
Calendar
.
DAY_OF_YEAR
,
-
1
);
//
calendar.add(Calendar.DAY_OF_YEAR, -1);
String
yestertoday
=
sdf
.
format
(
calendar
.
getTime
());
//
String yestertoday = sdf.format(calendar.getTime());
String
oldKey
=
String
.
format
(
"SIGNCENTER_K030_%s_%s"
,
issueId
,
today
);
//
String oldKey = String.format("SIGNCENTER_K030_%s_%s", issueId, today);
String
newKey
=
String
.
format
(
"SIGNCENTER_k030_%s_%s"
,
issueId
,
yestertoday
);
//
String newKey = String.format("SIGNCENTER_k030_%s_%s", issueId, yestertoday);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
//
Map<String, String> map = new HashMap<>();
map
.
put
(
"key"
,
oldKey
);
//
map.put("key", oldKey);
map
.
put
(
"newKey"
,
newKey
);
//
map.put("newKey", newKey);
Response
response
=
given
().
params
(
map
).
get
(
activityHost
+
"/signtest/redis/renameKey"
);
//
Response response = given().params(map).get(activityHost + "/signtest/redis/renameKey");
String
result
=
response
.
jsonPath
().
getString
(
"success"
);
//
String result = response.jsonPath().getString("success");
Assert
.
assertEquals
(
result
,
"true"
,
"重命名redis键值失败"
);
//
Assert.assertEquals(result, "true", "重命名redis键值失败");
// 查询下期是否开始
// 查询下期是否开始
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid3
);
Response
homeInfoRes
=
ContractSignService
.
getHomeInfo
(
actId
,
uid3
);
...
@@ -253,6 +281,8 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -253,6 +281,8 @@ public class ContractSign_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
periodShow
,
period
,
"参与期次号不正确"
);
Assert
.
assertEquals
(
periodShow
,
period
,
"参与期次号不正确"
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
String
status
=
homeInfoRes
.
jsonPath
().
getString
(
"data.status"
);
Assert
.
assertEquals
(
status
,
"6"
,
"当前参与状态不正确"
);
Assert
.
assertEquals
(
status
,
"6"
,
"当前参与状态不正确"
);
String
hasReward
=
homeInfoRes
.
jsonPath
().
getString
(
"data.hasReward"
);
Assert
.
assertEquals
(
hasReward
,
"true"
,
"今日是否有奖励状态不正确"
);
// 查询参与记录
// 查询参与记录
Response
recordRes
=
ContractSignService
.
getContracts
(
actId
,
uid3
);
Response
recordRes
=
ContractSignService
.
getContracts
(
actId
,
uid3
);
String
contractId
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].contractId"
);
String
contractId
=
recordRes
.
jsonPath
().
getString
(
"data.list[0].contractId"
);
...
@@ -279,7 +309,7 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -279,7 +309,7 @@ public class ContractSign_signTest extends DuibaTestBase {
ContractSignService
.
getReward
(
contractId
,
uid4
);
ContractSignService
.
getReward
(
contractId
,
uid4
);
}
}
@Test
(
description
=
"打卡/收益排行榜,活动ID=2"
,
priority
=
6
)
@Test
(
description
=
"打卡/收益排行榜,活动ID=2"
,
priority
=
7
)
public
void
参与记录
()
throws
Exception
{
public
void
参与记录
()
throws
Exception
{
// 查询断签用户参与记录
// 查询断签用户参与记录
Response
recordRes
=
ContractSignService
.
getContracts
(
"2"
,
uid2
);
Response
recordRes
=
ContractSignService
.
getContracts
(
"2"
,
uid2
);
...
@@ -313,7 +343,7 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -313,7 +343,7 @@ public class ContractSign_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
totalProfit
,
7000
,
"累计收益不正确"
);
Assert
.
assertEquals
(
totalProfit
,
7000
,
"累计收益不正确"
);
}
}
@Test
(
description
=
"打卡/收益排行榜,活动ID=2"
,
priority
=
7
)
@Test
(
description
=
"打卡/收益排行榜,活动ID=2"
,
priority
=
8
)
public
void
排行榜
()
throws
Exception
{
public
void
排行榜
()
throws
Exception
{
String
actId
=
"2"
;
String
actId
=
"2"
;
//查询签到次数排行榜
//查询签到次数排行榜
...
@@ -348,8 +378,8 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -348,8 +378,8 @@ public class ContractSign_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
nickName2
,
"Auto3720"
,
"用户名不正确"
);
Assert
.
assertEquals
(
nickName2
,
"Auto3720"
,
"用户名不正确"
);
}
}
@Test
(
description
=
"中奖轮播"
,
priority
=
8
)
@Test
(
description
=
"中奖轮播"
,
priority
=
9
)
public
void
中奖轮播
()
throws
Exception
{
public
void
中奖轮播
_
固定额度
()
throws
Exception
{
//删除redis key
//删除redis key
// Map<String, String> carouselMap = new HashMap<>();
// Map<String, String> carouselMap = new HashMap<>();
// carouselMap.put("key", );
// carouselMap.put("key", );
...
@@ -415,7 +445,7 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -415,7 +445,7 @@ public class ContractSign_signTest extends DuibaTestBase {
}
}
}
}
p
rivate
void
modifyJoinTime
(
String
actId
,
String
date
,
String
startTime
,
String
endTime
)
throws
Exception
{
p
ublic
void
modifyJoinTime
(
String
actId
,
String
date
,
String
startTime
,
String
endTime
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"title"
,
"自动化_报名截止时间"
);
map
.
put
(
"title"
,
"自动化_报名截止时间"
);
map
.
put
(
"betCount"
,
"1000"
);
map
.
put
(
"betCount"
,
"1000"
);
...
@@ -438,7 +468,7 @@ public class ContractSign_signTest extends DuibaTestBase {
...
@@ -438,7 +468,7 @@ public class ContractSign_signTest extends DuibaTestBase {
map
.
put
(
"openType"
,
"0"
);
map
.
put
(
"openType"
,
"0"
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
Response
response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
body
(
jsonObject
).
post
(
"https://mng.duibatest.com.cn/newmanager/signContract/save"
);
Response
response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
body
(
jsonObject
).
post
(
"https://mng.duibatest.com.cn/newmanager/signContract/save"
);
response
.
prettyPrint
();
//
response.prettyPrint();
try
{
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/signContract/save接口失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
,
"/signContract/save接口失败"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
src/test/java/http/cases/SignTest/补签测试_signTest.java
View file @
00a83fc8
...
@@ -265,6 +265,7 @@ public class 补签测试_signTest extends DuibaTestBase {
...
@@ -265,6 +265,7 @@ public class 补签测试_signTest extends DuibaTestBase {
map
.
put
(
"cirReward"
,
"{\"rwType\":\"CIRCLE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":null,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":true}"
);
map
.
put
(
"cirReward"
,
"{\"rwType\":\"CIRCLE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":null,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":true}"
);
map
.
put
(
"acmReward"
,
"{\"rwType\":\"ACCUMULATE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"acmReward"
,
"{\"rwType\":\"ACCUMULATE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"firstSignReward"
,
"{\"rwType\":\"FIRST_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"firstSignReward"
,
"{\"rwType\":\"FIRST_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"cntOnceReward"
,
"{\"rwType\":null,\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":null,\"open\":false}"
);
map
.
put
(
"fullSignReward"
,
"{\"rwType\":\"FULL_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"fullSignReward"
,
"{\"rwType\":\"FULL_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"operatingPositions"
,
"[]"
);
map
.
put
(
"operatingPositions"
,
"[]"
);
logger
.
info
(
"请求configEdit接口"
);
logger
.
info
(
"请求configEdit接口"
);
...
@@ -318,6 +319,7 @@ public class 补签测试_signTest extends DuibaTestBase {
...
@@ -318,6 +319,7 @@ public class 补签测试_signTest extends DuibaTestBase {
map
.
put
(
"cirReward"
,
"{\"rwType\":\"CIRCLE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":null,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":true}"
);
map
.
put
(
"cirReward"
,
"{\"rwType\":\"CIRCLE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":null,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":true}"
);
map
.
put
(
"acmReward"
,
"{\"rwType\":\"ACCUMULATE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"acmReward"
,
"{\"rwType\":\"ACCUMULATE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"firstSignReward"
,
"{\"rwType\":\"FIRST_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"firstSignReward"
,
"{\"rwType\":\"FIRST_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"cntOnceReward"
,
"{\"rwType\":null,\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":null,\"open\":false}"
);
map
.
put
(
"fullSignReward"
,
"{\"rwType\":\"FULL_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"fullSignReward"
,
"{\"rwType\":\"FULL_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"operatingPositions"
,
"[]"
);
map
.
put
(
"operatingPositions"
,
"[]"
);
logger
.
info
(
"请求configEdit接口"
);
logger
.
info
(
"请求configEdit接口"
);
...
@@ -366,6 +368,7 @@ public class 补签测试_signTest extends DuibaTestBase {
...
@@ -366,6 +368,7 @@ public class 补签测试_signTest extends DuibaTestBase {
map
.
put
(
"cirReward"
,
"{\"rwType\":\"CIRCLE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":null,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":true}"
);
map
.
put
(
"cirReward"
,
"{\"rwType\":\"CIRCLE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":null,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":true}"
);
map
.
put
(
"acmReward"
,
"{\"rwType\":\"ACCUMULATE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"acmReward"
,
"{\"rwType\":\"ACCUMULATE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"firstSignReward"
,
"{\"rwType\":\"FIRST_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"firstSignReward"
,
"{\"rwType\":\"FIRST_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"cntOnceReward"
,
"{\"rwType\":null,\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":null,\"open\":false}"
);
map
.
put
(
"fullSignReward"
,
"{\"rwType\":\"FULL_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"fullSignReward"
,
"{\"rwType\":\"FULL_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"operatingPositions"
,
"[]"
);
map
.
put
(
"operatingPositions"
,
"[]"
);
logger
.
info
(
"请求configEdit接口"
);
logger
.
info
(
"请求configEdit接口"
);
...
...
src/test/java/http/cases/WalletTest/种红包配置校验_AccessTest.java
View file @
00a83fc8
...
@@ -108,13 +108,11 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
...
@@ -108,13 +108,11 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
//dafuweng登陆获取cookies
//dafuweng登陆获取cookies
Map
cookies
=
authorization
.
dafuwengLogin
(
uid4
);
Map
cookies
=
authorization
.
dafuwengLogin
(
uid4
);
//调用种植seed
//调用种植seed
Response
response
=
seedRedPacketService
.
seed
(
cookies
,
"
1
"
,
"424"
,
"1"
);
Response
response
=
seedRedPacketService
.
seed
(
cookies
,
"
6
"
,
"424"
,
"1"
);
//种子号
//种子号
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderNum"
);
String
orderId
=
response
.
jsonPath
().
getString
(
"data.orderNum"
);
Assert
.
assertNotNull
(
orderId
,
"订单号为空"
);
Assert
.
assertNotNull
(
orderId
,
"订单号为空"
);
logger
.
info
(
"红包订单为:"
+
orderId
);
logger
.
info
(
"红包订单为:"
+
orderId
);
//红包衰减
Thread
.
sleep
(
65000
);
//获取种植结果状态getOrderStatus,异步接口,while循环,status为2处理完成,1处理中
//获取种植结果状态getOrderStatus,异步接口,while循环,status为2处理完成,1处理中
response
=
seedRedPacketService
.
getOrderStatus
(
cookies
,
orderId
);
response
=
seedRedPacketService
.
getOrderStatus
(
cookies
,
orderId
);
String
status
=
response
.
jsonPath
().
getString
(
"data"
);
String
status
=
response
.
jsonPath
().
getString
(
"data"
);
...
@@ -125,7 +123,9 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
...
@@ -125,7 +123,9 @@ public class 种红包配置校验_AccessTest extends DuibaTestBase{
i
--;
i
--;
}
}
//获取种植获得金额
//获取种植获得金额
response
=
seedRedPacketService
.
reap
(
cookies
,
"1"
,
orderId
);
//红包衰减
Thread
.
sleep
(
70000
);
response
=
seedRedPacketService
.
reap
(
cookies
,
"6"
,
orderId
);
response
.
prettyPrint
();
response
.
prettyPrint
();
String
isDecr
=
response
.
jsonPath
().
getString
(
"data.isDecr"
);
String
isDecr
=
response
.
jsonPath
().
getString
(
"data.isDecr"
);
Assert
.
assertEquals
(
isDecr
,
"true"
,
"红包衰减标识校验失败"
);
Assert
.
assertEquals
(
isDecr
,
"true"
,
"红包衰减标识校验失败"
);
...
...
src/test/java/http/service/Activity/SignactivityService.java
View file @
00a83fc8
...
@@ -164,6 +164,7 @@ public class SignactivityService {
...
@@ -164,6 +164,7 @@ public class SignactivityService {
map
.
put
(
"cirReward"
,
"{\"rwType\":\"CIRCLE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":null,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"cirReward"
,
"{\"rwType\":\"CIRCLE\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":null,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":false}"
);
map
.
put
(
"acmReward"
,
"{\"rwType\":\"ACCUMULATE\",\"plActSkinId\":100,\"plActId\":1154,\"items\":[{\"days\":2,\"credits\":10,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":true}"
);
map
.
put
(
"acmReward"
,
"{\"rwType\":\"ACCUMULATE\",\"plActSkinId\":100,\"plActId\":1154,\"items\":[{\"days\":2,\"credits\":10,\"activityCount\":1}],\"plSkinOpen2Dev\":false,\"open\":true}"
);
map
.
put
(
"firstSignReward"
,
"{\"rwType\":\"FIRST_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":null,\"open\":false}"
);
map
.
put
(
"firstSignReward"
,
"{\"rwType\":\"FIRST_SIGN\",\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":null,\"open\":false}"
);
map
.
put
(
"cntOnceReward"
,
"{\"rwType\":null,\"plActSkinId\":null,\"plActId\":null,\"items\":[{\"days\":1,\"credits\":0,\"activityCount\":1}],\"plSkinOpen2Dev\":null,\"open\":false}"
);
map
.
put
(
"operatingPositions"
,
"[]"
);
map
.
put
(
"operatingPositions"
,
"[]"
);
logger
.
info
(
"请求configEdit接口"
);
logger
.
info
(
"请求configEdit接口"
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLogin
()).
params
(
map
).
post
(
"http://"
+
hdHost
+
"/signin/configEdit"
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLogin
()).
params
(
map
).
post
(
"http://"
+
hdHost
+
"/signin/configEdit"
);
...
...
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