Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oto
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
龚小红
oto
Commits
f8da03ea
Commit
f8da03ea
authored
Aug 31, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/20210823-xmc
parents
8cccbce9
cf51bd64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
304 additions
and
57 deletions
+304
-57
Answer.java
src/test/java/com/kjj/cases/live/answer/Answer.java
+304
-57
No files found.
src/test/java/com/kjj/cases/live/answer/Answer.java
View file @
f8da03ea
...
@@ -2,6 +2,8 @@ package com.kjj.cases.live.answer;
...
@@ -2,6 +2,8 @@ package com.kjj.cases.live.answer;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.kjj.bean.answer.*
;
import
com.kjj.bean.answer.*
;
import
com.kjj.bean.manager.AnswerBean
;
import
com.kjj.bean.manager.AnswerListBean
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.cases.admin.Authorization
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.constants.LiveConstants
;
...
@@ -100,9 +102,69 @@ public class Answer implements Authorization {
...
@@ -100,9 +102,69 @@ public class Answer implements Authorization {
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesSaveOrUpdate
,
"主播端添加有奖答题现金红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesSaveOrUpdate
,
"主播端添加有奖答题现金红包失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"管理后台添加有奖答题现金红包"
,
priority
=
3
)
public
void
管理后台添加有奖答题现金红包
(){
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
//Params.put("liveId",5708);
Params
.
put
(
"quesType"
,
"1"
);
Params
.
put
(
"supportInvite"
,
0
);
//是否支持邀请,0不支持,1支持(默认)
Params
.
put
(
"agentReceiveType"
,
1
);
//代理人能否参与抽奖,0不支持(默认),1支持
List
<
AnswerBean
>
Answers1
=
new
ArrayList
<>();
AnswerBean
Answer1
=
new
AnswerBean
();
Answer1
.
setOptionDetail
(
"正确"
);
Answer1
.
setOptionType
(
1
);
Answers1
.
add
(
Answer1
);
AnswerBean
Answer3
=
new
AnswerBean
();
Answer3
.
setOptionDetail
(
"错误"
);
Answer3
.
setOptionType
(
2
);
Answers1
.
add
(
Answer3
);
AnswerListBean
bean1
=
new
AnswerListBean
();
bean1
.
setQuestionDetail
(
"直播中答题现金红包"
);
bean1
.
setOptionList
(
Answers1
);
Params
.
put
(
"questionConf"
,
bean1
);
AddReward
redConf1
=
new
AddReward
();
redConf1
.
setAmount
(
3000
);
redConf1
.
setShowAmount
(
3000
);
redConf1
.
setNum
(
100
);
Params
.
put
(
"redConf"
,
redConf1
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_add
);
boolean
data1
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data1
);
Assert
.
assertTrue
(
data1
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_add
,
"答题红包配置失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"管理后台添加有奖答题福利"
,
priority
=
4
)
public
void
管理后台添加有奖答题福利
(){
Map
<
String
,
Object
>
Params
=
new
HashMap
<>();
Params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
Params
.
put
(
"quesType"
,
"2"
);
Params
.
put
(
"supportInvite"
,
0
);
//是否支持邀请,0不支持,1支持(默认)
Params
.
put
(
"agentReceiveType"
,
1
);
//代理人能否参与抽奖,0不支持(默认),1支持
List
<
AnswerBean
>
Answers
=
new
ArrayList
<>();
AnswerBean
Answer
=
new
AnswerBean
();
Answer
.
setOptionDetail
(
"正确选项"
);
Answer
.
setOptionType
(
1
);
Answers
.
add
(
Answer
);
AnswerBean
Answer2
=
new
AnswerBean
();
Answer2
.
setOptionDetail
(
"错误选项"
);
Answer2
.
setOptionType
(
2
);
Answers
.
add
(
Answer2
);
AnswerListBean
bean
=
new
AnswerListBean
();
bean
.
setQuestionDetail
(
"直播中答题福利"
);
bean
.
setOptionList
(
Answers
);
Params
.
put
(
"questionConf"
,
bean
);
Params
.
put
(
"redConf"
,
null
);
AddWelfareConf
welfareConf
=
new
AddWelfareConf
();
welfareConf
.
setWelfareId
(
190
);
welfareConf
.
setNum
(
100
);
Params
.
put
(
"welfareConf"
,
welfareConf
);
Response
response
=
network
.
postResponse
(
Params
,
BasicConfig
.
MANAGER_add
);
boolean
data
=
response
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
Params
,
BasicConfig
.
MANAGER_add
,
"新增答题实物奖品配置失败"
,
response
.
body
().
asString
()));
}
/*查询主播端有奖答题列表*/
/*查询主播端有奖答题列表*/
@Test
(
description
=
"查询主播端有奖答题列表"
,
priority
=
3
)
@Test
(
description
=
"查询主播端有奖答题列表"
,
priority
=
5
)
public
void
查询主播端有奖答题列表
()
public
void
查询主播端有奖答题列表
()
{
{
adminAuth
();
adminAuth
();
...
@@ -118,7 +180,7 @@ public class Answer implements Authorization {
...
@@ -118,7 +180,7 @@ public class Answer implements Authorization {
}
}
/*查询主播端未上架的有奖答题配置详情*/
/*查询主播端未上架的有奖答题配置详情*/
@Test
(
description
=
"查询第一轮答题现金红包"
,
priority
=
4
)
@Test
(
description
=
"查询第一轮答题现金红包"
,
priority
=
6
)
public
void
查询第一轮答题现金红包
()
public
void
查询第一轮答题现金红包
()
{
{
adminAuth
();
adminAuth
();
...
@@ -132,7 +194,7 @@ public class Answer implements Authorization {
...
@@ -132,7 +194,7 @@ public class Answer implements Authorization {
}
}
/*上架主播端未发放的有奖答题*/
/*上架主播端未发放的有奖答题*/
@Test
(
description
=
"上架第一轮答题现金红包"
,
priority
=
5
)
@Test
(
description
=
"上架第一轮答题现金红包"
,
priority
=
7
)
public
void
上架第一轮答题现金红包
()
public
void
上架第一轮答题现金红包
()
{
{
adminAuth
();
adminAuth
();
...
@@ -149,7 +211,7 @@ public class Answer implements Authorization {
...
@@ -149,7 +211,7 @@ public class Answer implements Authorization {
}
}
/*主播端发放答题红包*/
/*主播端发放答题红包*/
@Test
(
description
=
"发放第一轮现金红包"
,
priority
=
6
)
@Test
(
description
=
"发放第一轮现金红包"
,
priority
=
8
)
public
void
发放第一轮现金红包
()
public
void
发放第一轮现金红包
()
{
{
adminAuth
();
adminAuth
();
...
@@ -167,7 +229,17 @@ public class Answer implements Authorization {
...
@@ -167,7 +229,17 @@ public class Answer implements Authorization {
//访客端
//访客端
/*查询访客端有奖答题配置详情*/
/*查询访客端有奖答题配置详情*/
@Test
(
description
=
"访客A查询答题红包配置"
,
priority
=
7
)
@Test
(
description
=
"代理人关系绑定"
,
priority
=
11
)
public
void
代理人关系绑定
()
{
agentAuth
();
Map
<
String
,
Object
>
bindingParam
=
new
HashMap
<>();
bindingParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
bindingRes
=
network
.
postResponse
(
bindingParam
,
BasicConfig
.
MOBILE_binding
);
boolean
success
=
bindingRes
.
jsonPath
().
getJsonObject
(
"success"
);
System
.
out
.
println
(
success
);
Assert
.
assertTrue
(
success
,
network
.
message
(
bindingParam
,
BasicConfig
.
MOBILE_binding
,
"绑定失败"
,
bindingRes
.
body
().
asString
()));
}
@Test
(
description
=
"访客A查询答题红包配置"
,
priority
=
12
)
public
void
访客
A
查询答题红包配置
()
public
void
访客
A
查询答题红包配置
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -185,7 +257,7 @@ public class Answer implements Authorization {
...
@@ -185,7 +257,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包-错误选项*/
/*领取答题红包-错误选项*/
@Test
(
description
=
"访客领取答题红包错误选项"
,
priority
=
8
)
@Test
(
description
=
"访客领取答题红包错误选项"
,
priority
=
13
)
public
void
访客领取答题红包错误选项
()
public
void
访客领取答题红包错误选项
()
{
{
visitorAuth2
();
visitorAuth2
();
...
@@ -206,7 +278,7 @@ public class Answer implements Authorization {
...
@@ -206,7 +278,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包-访客A选择正确选项*/
/*领取答题红包-访客A选择正确选项*/
@Test
(
description
=
"领取答题红包答题正确"
,
priority
=
9
)
@Test
(
description
=
"领取答题红包答题正确"
,
priority
=
14
)
public
void
访客
A
领取答题红包答题正确
()
public
void
访客
A
领取答题红包答题正确
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -226,7 +298,7 @@ public class Answer implements Authorization {
...
@@ -226,7 +298,7 @@ public class Answer implements Authorization {
/*领取答题红包结果*/
/*领取答题红包结果*/
@Test
(
description
=
"查询用户A领取答题红包结果"
,
priority
=
1
0
)
@Test
(
description
=
"查询用户A领取答题红包结果"
,
priority
=
1
5
)
public
void
查询用户
A
领取答题红包结果
()
public
void
查询用户
A
领取答题红包结果
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -250,7 +322,7 @@ public class Answer implements Authorization {
...
@@ -250,7 +322,7 @@ public class Answer implements Authorization {
/*领取答题红包-黑名单用户选择正确选项*/
/*领取答题红包-黑名单用户选择正确选项*/
@Test
(
description
=
"领取答题红包-黑名单用户答题正确"
,
priority
=
1
1
)
@Test
(
description
=
"领取答题红包-黑名单用户答题正确"
,
priority
=
1
6
)
public
void
黑名单用户领取答题红包
()
public
void
黑名单用户领取答题红包
()
{
{
visitorAuth7
();
visitorAuth7
();
...
@@ -269,7 +341,7 @@ public class Answer implements Authorization {
...
@@ -269,7 +341,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包结果*/
/*领取答题红包结果*/
@Test
(
description
=
"黑名单用户领取答题红包结果"
,
priority
=
1
2
)
@Test
(
description
=
"黑名单用户领取答题红包结果"
,
priority
=
1
7
)
public
void
黑名单用户领取答题红包结果
()
public
void
黑名单用户领取答题红包结果
()
{
{
visitorAuth7
();
visitorAuth7
();
...
@@ -290,7 +362,7 @@ public class Answer implements Authorization {
...
@@ -290,7 +362,7 @@ public class Answer implements Authorization {
/*代理人领取答题红包*/
/*代理人领取答题红包*/
@Test
(
description
=
"代理人领取答题现金红包"
,
priority
=
1
3
)
@Test
(
description
=
"代理人领取答题现金红包"
,
priority
=
1
8
)
public
void
代理人领取答题现金红包
()
public
void
代理人领取答题现金红包
()
{
{
agentAuth
();
agentAuth
();
...
@@ -308,7 +380,7 @@ public class Answer implements Authorization {
...
@@ -308,7 +380,7 @@ public class Answer implements Authorization {
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"代理人领取答题红包结果"
,
priority
=
1
4
)
@Test
(
description
=
"代理人领取答题红包结果"
,
priority
=
1
9
)
public
void
代理人领取答题红包结果
()
public
void
代理人领取答题红包结果
()
{
{
agentAuth
();
agentAuth
();
...
@@ -328,7 +400,7 @@ public class Answer implements Authorization {
...
@@ -328,7 +400,7 @@ public class Answer implements Authorization {
}
}
/*查询主播端未上架的有奖答题配置详情*/
/*查询主播端未上架的有奖答题配置详情*/
@Test
(
description
=
"查询第二轮答题现金红包"
,
priority
=
15
)
@Test
(
description
=
"查询第二轮答题现金红包"
,
priority
=
20
)
public
void
查询第二轮答题现金红包
()
public
void
查询第二轮答题现金红包
()
{
{
adminAuth
();
adminAuth
();
...
@@ -342,7 +414,7 @@ public class Answer implements Authorization {
...
@@ -342,7 +414,7 @@ public class Answer implements Authorization {
}
}
/*上架主播端未发放的有奖答题*/
/*上架主播端未发放的有奖答题*/
@Test
(
description
=
"上架第二轮答题现金红包"
,
priority
=
16
)
@Test
(
description
=
"上架第二轮答题现金红包"
,
priority
=
21
)
public
void
上架第二轮答题现金红包
()
public
void
上架第二轮答题现金红包
()
{
{
ThreadSleepUtils
.
sleep
(
100000
);
ThreadSleepUtils
.
sleep
(
100000
);
...
@@ -357,7 +429,7 @@ public class Answer implements Authorization {
...
@@ -357,7 +429,7 @@ public class Answer implements Authorization {
}
}
/*主播端发放答题红包*/
/*主播端发放答题红包*/
@Test
(
description
=
"发放第二轮现金红包"
,
priority
=
17
)
@Test
(
description
=
"发放第二轮现金红包"
,
priority
=
22
)
public
void
发放第二轮现金红包
()
public
void
发放第二轮现金红包
()
{
{
adminAuth
();
adminAuth
();
...
@@ -372,7 +444,7 @@ public class Answer implements Authorization {
...
@@ -372,7 +444,7 @@ public class Answer implements Authorization {
//访客端
//访客端
/*查询访客端有奖答题配置详情*/
/*查询访客端有奖答题配置详情*/
@Test
(
description
=
"访客A查询第二轮红包配置详情"
,
priority
=
18
)
@Test
(
description
=
"访客A查询第二轮红包配置详情"
,
priority
=
23
)
public
void
访客
A
查询第二轮红包配置详情
()
public
void
访客
A
查询第二轮红包配置详情
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -390,7 +462,7 @@ public class Answer implements Authorization {
...
@@ -390,7 +462,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包-访客A选择正确选项*/
/*领取答题红包-访客A选择正确选项*/
@Test
(
description
=
"访客A领取第二轮答题红包"
,
priority
=
19
)
@Test
(
description
=
"访客A领取第二轮答题红包"
,
priority
=
24
)
public
void
访客
A
领取第二轮答题红包
()
public
void
访客
A
领取第二轮答题红包
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -410,7 +482,7 @@ public class Answer implements Authorization {
...
@@ -410,7 +482,7 @@ public class Answer implements Authorization {
/*领取答题红包结果*/
/*领取答题红包结果*/
@Test
(
description
=
"第二轮领取答题红包结果"
,
priority
=
2
0
)
@Test
(
description
=
"第二轮领取答题红包结果"
,
priority
=
2
5
)
public
void
第二轮领取答题红包结果
()
public
void
第二轮领取答题红包结果
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -432,7 +504,7 @@ public class Answer implements Authorization {
...
@@ -432,7 +504,7 @@ public class Answer implements Authorization {
//*****************有奖答题福利类型*****************//
//*****************有奖答题福利类型*****************//
/*上架主播端未发放的有奖答题-福利*/
/*上架主播端未发放的有奖答题-福利*/
@Test
(
description
=
"上架第一轮答题福利"
,
priority
=
2
1
)
@Test
(
description
=
"上架第一轮答题福利"
,
priority
=
2
6
)
public
void
上架第一轮答题福利
()
public
void
上架第一轮答题福利
()
{
{
adminAuth
();
adminAuth
();
...
@@ -447,7 +519,7 @@ public class Answer implements Authorization {
...
@@ -447,7 +519,7 @@ public class Answer implements Authorization {
}
}
/*主播端发放福利类型的有奖答题*/
/*主播端发放福利类型的有奖答题*/
@Test
(
description
=
"发放第一轮答题福利"
,
priority
=
2
2
)
@Test
(
description
=
"发放第一轮答题福利"
,
priority
=
2
7
)
public
void
发放第一轮答题福利
()
public
void
发放第一轮答题福利
()
{
{
adminAuth
();
adminAuth
();
...
@@ -461,7 +533,7 @@ public class Answer implements Authorization {
...
@@ -461,7 +533,7 @@ public class Answer implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客查询第一轮答题福利"
,
priority
=
2
3
)
@Test
(
description
=
"访客查询第一轮答题福利"
,
priority
=
2
8
)
public
void
访客查询第一轮答题福利
()
public
void
访客查询第一轮答题福利
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -479,7 +551,7 @@ public class Answer implements Authorization {
...
@@ -479,7 +551,7 @@ public class Answer implements Authorization {
/*领取有奖答题福利类型-错误选项*/
/*领取有奖答题福利类型-错误选项*/
@Test
(
description
=
"领取有奖答题福利类型-错误选项"
,
priority
=
2
4
)
@Test
(
description
=
"领取有奖答题福利类型-错误选项"
,
priority
=
2
9
)
public
void
领取有奖答题福利选择错误
()
public
void
领取有奖答题福利选择错误
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -500,7 +572,7 @@ public class Answer implements Authorization {
...
@@ -500,7 +572,7 @@ public class Answer implements Authorization {
/*领取有奖答题福利类型-访客A选择正确选项*/
/*领取有奖答题福利类型-访客A选择正确选项*/
@Test
(
description
=
"领取有奖答题福利-访客A答题正确"
,
priority
=
25
)
@Test
(
description
=
"领取有奖答题福利-访客A答题正确"
,
priority
=
30
)
public
void
访客
A
领取有奖答题福利
()
public
void
访客
A
领取有奖答题福利
()
{
{
visitorAuth3
();
visitorAuth3
();
...
@@ -520,7 +592,8 @@ public class Answer implements Authorization {
...
@@ -520,7 +592,8 @@ public class Answer implements Authorization {
}
}
/*领取有奖答题福利类型结果*/
/*领取有奖答题福利类型结果*/
@Test
(
description
=
"查询访客A领取有奖答题福利结果"
,
priority
=
26
)
@Test
(
description
=
"查询访客A领取有奖答题福利结果"
,
priority
=
31
)
public
void
查询访客
A
领取有奖答题福利结果
()
public
void
查询访客
A
领取有奖答题福利结果
()
{
{
visitorAuth3
();
visitorAuth3
();
...
@@ -541,7 +614,7 @@ public class Answer implements Authorization {
...
@@ -541,7 +614,7 @@ public class Answer implements Authorization {
}
}
/*领取有奖答题福利类型-访客A选择正确选项*/
/*领取有奖答题福利类型-访客A选择正确选项*/
@Test
(
description
=
"非指定团队用户领取有奖答题福利-答题正确"
,
priority
=
27
)
@Test
(
description
=
"非指定团队用户领取有奖答题福利-答题正确"
,
priority
=
32
)
public
void
非指定团队用户领取有奖答题福利
()
public
void
非指定团队用户领取有奖答题福利
()
{
{
visitorAuth8
();
visitorAuth8
();
...
@@ -561,7 +634,7 @@ public class Answer implements Authorization {
...
@@ -561,7 +634,7 @@ public class Answer implements Authorization {
}
}
/*领取有奖答题福利类型结果*/
/*领取有奖答题福利类型结果*/
@Test
(
description
=
"查询非指定团队用户领取有奖答题结果"
,
priority
=
28
)
@Test
(
description
=
"查询非指定团队用户领取有奖答题结果"
,
priority
=
33
)
public
void
查询非指定团队用户领取有奖答题结果
()
public
void
查询非指定团队用户领取有奖答题结果
()
{
{
visitorAuth8
();
visitorAuth8
();
...
@@ -584,7 +657,7 @@ public class Answer implements Authorization {
...
@@ -584,7 +657,7 @@ public class Answer implements Authorization {
/*领取有奖答题福利类型-黑名单用户选择正确选项*/
/*领取有奖答题福利类型-黑名单用户选择正确选项*/
@Test
(
description
=
"黑名单用户领取有奖答题福利-答题正确"
,
priority
=
29
)
@Test
(
description
=
"黑名单用户领取有奖答题福利-答题正确"
,
priority
=
34
)
public
void
黑名单用户领取有奖答题福利
()
public
void
黑名单用户领取有奖答题福利
()
{
{
visitorAuth7
();
visitorAuth7
();
...
@@ -604,7 +677,7 @@ public class Answer implements Authorization {
...
@@ -604,7 +677,7 @@ public class Answer implements Authorization {
}
}
/*领取有奖答题福利类型结果*/
/*领取有奖答题福利类型结果*/
@Test
(
description
=
"查询黑名单用户领取有奖答题福利结果"
,
priority
=
3
0
)
@Test
(
description
=
"查询黑名单用户领取有奖答题福利结果"
,
priority
=
3
5
)
public
void
查询黑名单用户领取有奖答题福利结果
()
public
void
查询黑名单用户领取有奖答题福利结果
()
{
{
visitorAuth7
();
visitorAuth7
();
...
@@ -626,7 +699,7 @@ public class Answer implements Authorization {
...
@@ -626,7 +699,7 @@ public class Answer implements Authorization {
/*代理人领取有奖答题福利类型*/
/*代理人领取有奖答题福利类型*/
@Test
(
description
=
"代理人领取有奖答题福利"
,
priority
=
3
1
)
@Test
(
description
=
"代理人领取有奖答题福利"
,
priority
=
3
6
)
public
void
代理人领取有奖答题福利
()
{
public
void
代理人领取有奖答题福利
()
{
agentAuth
();
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -645,7 +718,7 @@ public class Answer implements Authorization {
...
@@ -645,7 +718,7 @@ public class Answer implements Authorization {
/*领取有奖答题福利类型结果*/
/*领取有奖答题福利类型结果*/
@Test
(
description
=
"查询代理人领取有奖答题福利结果"
,
priority
=
3
2
)
@Test
(
description
=
"查询代理人领取有奖答题福利结果"
,
priority
=
3
7
)
public
void
查询代理人领取有奖答题福利结果
()
public
void
查询代理人领取有奖答题福利结果
()
{
{
agentAuth
();
agentAuth
();
...
@@ -665,7 +738,7 @@ public class Answer implements Authorization {
...
@@ -665,7 +738,7 @@ public class Answer implements Authorization {
}
}
/*上架主播端未发放的有奖答题-福利*/
/*上架主播端未发放的有奖答题-福利*/
@Test
(
description
=
"上架第二轮答题福利"
,
priority
=
3
3
)
@Test
(
description
=
"上架第二轮答题福利"
,
priority
=
3
8
)
public
void
上架第二轮答题福利
()
public
void
上架第二轮答题福利
()
{
{
adminAuth
();
adminAuth
();
...
@@ -681,7 +754,7 @@ public class Answer implements Authorization {
...
@@ -681,7 +754,7 @@ public class Answer implements Authorization {
}
}
/*主播端发放福利类型的有奖答题*/
/*主播端发放福利类型的有奖答题*/
@Test
(
description
=
"发放第二轮答题福利"
,
priority
=
3
4
)
@Test
(
description
=
"发放第二轮答题福利"
,
priority
=
3
9
)
public
void
发放第二轮答题福利
()
public
void
发放第二轮答题福利
()
{
{
adminAuth
();
adminAuth
();
...
@@ -695,7 +768,7 @@ public class Answer implements Authorization {
...
@@ -695,7 +768,7 @@ public class Answer implements Authorization {
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客查询第二轮答题福利"
,
priority
=
35
)
@Test
(
description
=
"访客查询第二轮答题福利"
,
priority
=
40
)
public
void
访客查询第二轮答题福利
()
public
void
访客查询第二轮答题福利
()
{
{
visitorAuth3
();
visitorAuth3
();
...
@@ -714,7 +787,7 @@ public class Answer implements Authorization {
...
@@ -714,7 +787,7 @@ public class Answer implements Authorization {
/*领取有奖答题福利类型-访客A选择正确选项*/
/*领取有奖答题福利类型-访客A选择正确选项*/
@Test
(
description
=
"访客A第二轮领取有奖答题福利-答题正确"
,
priority
=
36
)
@Test
(
description
=
"访客A第二轮领取有奖答题福利-答题正确"
,
priority
=
41
)
public
void
访客
A
第二轮领取有奖答题福利
()
public
void
访客
A
第二轮领取有奖答题福利
()
{
{
visitorAuth3
();
visitorAuth3
();
...
@@ -733,7 +806,7 @@ public class Answer implements Authorization {
...
@@ -733,7 +806,7 @@ public class Answer implements Authorization {
}
}
/*领取有奖答题福利类型结果*/
/*领取有奖答题福利类型结果*/
@Test
(
description
=
"查询访客A第二轮有奖答题福利类型结果"
,
priority
=
37
)
@Test
(
description
=
"查询访客A第二轮有奖答题福利类型结果"
,
priority
=
42
)
public
void
查询访客
A
第二轮有奖答题福利类型结果
()
public
void
查询访客
A
第二轮有奖答题福利类型结果
()
{
{
visitorAuth3
();
visitorAuth3
();
...
@@ -758,7 +831,7 @@ public class Answer implements Authorization {
...
@@ -758,7 +831,7 @@ public class Answer implements Authorization {
* 有奖答题无限制中奖
* 有奖答题无限制中奖
*/
*/
@Test
(
description
=
"修改本场答题规则为无限制"
,
priority
=
38
)
@Test
(
description
=
"修改本场答题规则为无限制"
,
priority
=
43
)
public
void
修改本场答题规则为无限制
()
{
public
void
修改本场答题规则为无限制
()
{
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
updateParam
=
new
HashMap
<>();
updateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
updateParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -772,7 +845,7 @@ public class Answer implements Authorization {
...
@@ -772,7 +845,7 @@ public class Answer implements Authorization {
}
}
@Test
(
description
=
"查询答题规则无限制是否配置成功"
,
priority
=
39
)
@Test
(
description
=
"查询答题规则无限制是否配置成功"
,
priority
=
44
)
public
void
查询答题规则无限制是否配置成功
()
{
public
void
查询答题规则无限制是否配置成功
()
{
Map
<
String
,
Object
>
getConfParam
=
new
HashMap
<>();
Map
<
String
,
Object
>
getConfParam
=
new
HashMap
<>();
getConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
getConfParam
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
@@ -793,7 +866,7 @@ public class Answer implements Authorization {
...
@@ -793,7 +866,7 @@ public class Answer implements Authorization {
*/
*/
/*查询主播端有奖答题列表*/
/*查询主播端有奖答题列表*/
@Test
(
description
=
"查询有奖答题列表"
,
priority
=
4
0
)
@Test
(
description
=
"查询有奖答题列表"
,
priority
=
4
5
)
public
void
查询有奖答题列表
()
public
void
查询有奖答题列表
()
{
{
adminAuth
();
adminAuth
();
...
@@ -809,7 +882,7 @@ public class Answer implements Authorization {
...
@@ -809,7 +882,7 @@ public class Answer implements Authorization {
}
}
/*查询主播端未上架的有奖答题配置详情*/
/*查询主播端未上架的有奖答题配置详情*/
@Test
(
description
=
"主播端查询第三轮答题现金红包"
,
priority
=
4
1
)
@Test
(
description
=
"主播端查询第三轮答题现金红包"
,
priority
=
4
6
)
public
void
主播端查询第三轮答题现金红包
()
public
void
主播端查询第三轮答题现金红包
()
{
{
adminAuth
();
adminAuth
();
...
@@ -823,7 +896,7 @@ public class Answer implements Authorization {
...
@@ -823,7 +896,7 @@ public class Answer implements Authorization {
}
}
/*上架主播端未发放的有奖答题*/
/*上架主播端未发放的有奖答题*/
@Test
(
description
=
"上架第三轮答题现金红包"
,
priority
=
4
2
)
@Test
(
description
=
"上架第三轮答题现金红包"
,
priority
=
4
7
)
public
void
上架第三轮答题现金红包
()
public
void
上架第三轮答题现金红包
()
{
{
adminAuth
();
adminAuth
();
...
@@ -838,7 +911,7 @@ public class Answer implements Authorization {
...
@@ -838,7 +911,7 @@ public class Answer implements Authorization {
}
}
/*主播端发放答题红包*/
/*主播端发放答题红包*/
@Test
(
description
=
"发放第三轮现金红包"
,
priority
=
4
3
)
@Test
(
description
=
"发放第三轮现金红包"
,
priority
=
4
8
)
public
void
发放第三轮现金红包
()
public
void
发放第三轮现金红包
()
{
{
adminAuth
();
adminAuth
();
...
@@ -854,7 +927,7 @@ public class Answer implements Authorization {
...
@@ -854,7 +927,7 @@ public class Answer implements Authorization {
//访客端
//访客端
/*查询访客端有奖答题配置详情*/
/*查询访客端有奖答题配置详情*/
@Test
(
description
=
"访客A查询第三轮答题红包配置"
,
priority
=
4
4
)
@Test
(
description
=
"访客A查询第三轮答题红包配置"
,
priority
=
4
9
)
public
void
访客
A
查询第三轮答题红包配置
()
public
void
访客
A
查询第三轮答题红包配置
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -872,7 +945,7 @@ public class Answer implements Authorization {
...
@@ -872,7 +945,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包-错误选项*/
/*领取答题红包-错误选项*/
@Test
(
description
=
"访客领取答题红包-错误选项"
,
priority
=
45
)
@Test
(
description
=
"访客领取答题红包-错误选项"
,
priority
=
50
)
public
void
访客领取答题红包
_
错误选项
()
public
void
访客领取答题红包
_
错误选项
()
{
{
visitorAuth2
();
visitorAuth2
();
...
@@ -893,7 +966,7 @@ public class Answer implements Authorization {
...
@@ -893,7 +966,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包-访客A选择正确选项*/
/*领取答题红包-访客A选择正确选项*/
@Test
(
description
=
"领取答题红包_答题正确"
,
priority
=
46
)
@Test
(
description
=
"领取答题红包_答题正确"
,
priority
=
51
)
public
void
访客
A
领取答题红包
_
答题正确
()
public
void
访客
A
领取答题红包
_
答题正确
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -915,7 +988,7 @@ public class Answer implements Authorization {
...
@@ -915,7 +988,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包结果*/
/*领取答题红包结果*/
@Test
(
description
=
"查询访客A领取答题红包结果"
,
priority
=
47
)
@Test
(
description
=
"查询访客A领取答题红包结果"
,
priority
=
52
)
public
void
查询访客
A
领取答题红包结果
()
public
void
查询访客
A
领取答题红包结果
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -937,7 +1010,7 @@ public class Answer implements Authorization {
...
@@ -937,7 +1010,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包-黑名单用户选择正确选项*/
/*领取答题红包-黑名单用户选择正确选项*/
@Test
(
description
=
"领取答题红包-黑名单用户答题正确"
,
priority
=
48
)
@Test
(
description
=
"领取答题红包-黑名单用户答题正确"
,
priority
=
53
)
public
void
黑名单用户领取答题红包成功
()
public
void
黑名单用户领取答题红包成功
()
{
{
visitorAuth7
();
visitorAuth7
();
...
@@ -958,7 +1031,7 @@ public class Answer implements Authorization {
...
@@ -958,7 +1031,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包结果*/
/*领取答题红包结果*/
@Test
(
description
=
"查询黑名单用户领取答题红包结果"
,
priority
=
49
)
@Test
(
description
=
"查询黑名单用户领取答题红包结果"
,
priority
=
54
)
public
void
查询黑名单用户领取答题红包结果
()
public
void
查询黑名单用户领取答题红包结果
()
{
{
visitorAuth7
();
visitorAuth7
();
...
@@ -980,7 +1053,7 @@ public class Answer implements Authorization {
...
@@ -980,7 +1053,7 @@ public class Answer implements Authorization {
}
}
/*代理人领取答题红包*/
/*代理人领取答题红包*/
@Test
(
description
=
"代理人领取答题红包"
,
priority
=
5
0
)
@Test
(
description
=
"代理人领取答题红包"
,
priority
=
5
5
)
public
void
代理人领取答题红包
()
public
void
代理人领取答题红包
()
{
{
agentAuth
();
agentAuth
();
...
@@ -1001,7 +1074,7 @@ public class Answer implements Authorization {
...
@@ -1001,7 +1074,7 @@ public class Answer implements Authorization {
}
}
/*领取答题红包结果*/
/*领取答题红包结果*/
@Test
(
description
=
"查询代理人领取答题红包结果"
,
priority
=
5
1
)
@Test
(
description
=
"查询代理人领取答题红包结果"
,
priority
=
5
6
)
public
void
查询代理人领取答题红包结果
()
public
void
查询代理人领取答题红包结果
()
{
{
agentAuth
();
agentAuth
();
...
@@ -1024,7 +1097,7 @@ public class Answer implements Authorization {
...
@@ -1024,7 +1097,7 @@ public class Answer implements Authorization {
/*上架主播端未发放的有奖答题-福利*/
/*上架主播端未发放的有奖答题-福利*/
@Test
(
description
=
"上架第三轮答题福利"
,
priority
=
5
2
)
@Test
(
description
=
"上架第三轮答题福利"
,
priority
=
5
7
)
public
void
上架第三轮答题福利
()
public
void
上架第三轮答题福利
()
{
{
adminAuth
();
adminAuth
();
...
@@ -1039,7 +1112,7 @@ public class Answer implements Authorization {
...
@@ -1039,7 +1112,7 @@ public class Answer implements Authorization {
}
}
/*主播端发放福利类型的有奖答题*/
/*主播端发放福利类型的有奖答题*/
@Test
(
description
=
"发放第三轮答题福利"
,
priority
=
5
3
)
@Test
(
description
=
"发放第三轮答题福利"
,
priority
=
5
8
)
public
void
发放第三轮答题福利
()
public
void
发放第三轮答题福利
()
{
{
adminAuth
();
adminAuth
();
...
@@ -1053,7 +1126,7 @@ public class Answer implements Authorization {
...
@@ -1053,7 +1126,7 @@ public class Answer implements Authorization {
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客查询第三轮答题福利"
,
priority
=
5
4
)
@Test
(
description
=
"访客查询第三轮答题福利"
,
priority
=
5
9
)
public
void
访客查询第三轮答题福利
()
public
void
访客查询第三轮答题福利
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -1072,7 +1145,7 @@ public class Answer implements Authorization {
...
@@ -1072,7 +1145,7 @@ public class Answer implements Authorization {
/*领取有奖答题福利类型-错误选项*/
/*领取有奖答题福利类型-错误选项*/
@Test
(
description
=
"领取有奖答题福利类型-错误选项"
,
priority
=
55
)
@Test
(
description
=
"领取有奖答题福利类型-错误选项"
,
priority
=
60
)
public
void
领取有奖答题福利类型选择错误
()
public
void
领取有奖答题福利类型选择错误
()
{
{
visitorAuth9
();
visitorAuth9
();
...
@@ -1093,7 +1166,7 @@ public class Answer implements Authorization {
...
@@ -1093,7 +1166,7 @@ public class Answer implements Authorization {
/*领取有奖答题福利类型-访客A选择正确选项*/
/*领取有奖答题福利类型-访客A选择正确选项*/
@Test
(
description
=
"领取有奖答题福利类型-访客A答题正确"
,
priority
=
56
)
@Test
(
description
=
"领取有奖答题福利类型-访客A答题正确"
,
priority
=
61
)
public
void
访客
A
领取有奖答题福利类型
()
public
void
访客
A
领取有奖答题福利类型
()
{
{
visitorAuth3
();
visitorAuth3
();
...
@@ -1111,14 +1184,14 @@ public class Answer implements Authorization {
...
@@ -1111,14 +1184,14 @@ public class Answer implements Authorization {
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"答题失败"
,
response
.
body
().
asString
()));
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"答题失败"
,
response
.
body
().
asString
()));
}
}
@Test
(
description
=
"访客A领取有奖答题福利结果"
,
priority
=
57
)
@Test
(
description
=
"访客A领取有奖答题福利结果"
,
priority
=
62
)
public
void
访客
A
领取有奖答题福利结果
()
public
void
访客
A
领取有奖答题福利结果
()
{
{
visitorAuth3
();
visitorAuth3
();
ThreadSleepUtils
.
sleep
(
3000
);
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
2
).
getQuesConfId
()
);
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
5
).
getQuesConfId
()
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
System
.
out
.
println
(
result
);
...
@@ -1130,5 +1203,179 @@ public class Answer implements Authorization {
...
@@ -1130,5 +1203,179 @@ public class Answer implements Authorization {
}
}
/*上架主播端未发放的有奖答题-红包*/
@Test
(
description
=
"上架第四轮有奖答题红包"
,
priority
=
63
)
public
void
上架第四轮有奖答题红包
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
100000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
6
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
);
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
,
"上架答题红包失败"
,
response
.
body
().
asString
()));
}
/*主播端发放福利类型的有奖答题*/
@Test
(
description
=
"发放第四轮有奖答题红包"
,
priority
=
64
)
public
void
发放第四轮有奖答题红包
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
6
).
getQuesConfId
());
// params.put("liveId","Kj21NDU2NzE");
// params.put("confId",this.quesConfId.get(10).getQuesConfId());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人查询第四轮有奖答题红包"
,
priority
=
65
)
public
void
代理人查询第四轮有奖答题红包
()
{
agentAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesDetail
);
List
<
QuestionList
.
question
>
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
response
.
jsonPath
().
get
(
"data.questionList"
)),
QuestionList
.
question
.
class
);
System
.
out
.
println
(
list
);
Optional
<
QuestionList
.
question
>
wrongAnswerOption
=
list
.
stream
().
filter
(
option
->
Objects
.
equals
(
option
.
getOptionType
(),
2
)).
findAny
();
this
.
wronganswer
=
wrongAnswerOption
.
get
();
Optional
<
QuestionList
.
question
>
correctAnswerOption
=
list
.
stream
().
filter
(
option
->
Objects
.
equals
(
option
.
getOptionType
(),
1
)).
findFirst
();
this
.
rightanswer
=
correctAnswerOption
.
get
();
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"查询访客端有奖答题配置详情失败"
,
response
.
body
().
asString
()));
//校验该题目是否允许邀请,0为不支持
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
supportInvite
=
response
.
jsonPath
().
getBoolean
(
"data.supportInvite"
);
System
.
out
.
println
(
supportInvite
);
Assert
.
assertFalse
(
supportInvite
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"不支持邀请配置有误"
,
response
.
body
().
asString
()));
}
/*代理人领取答题红包*/
@Test
(
description
=
"代理人领取第四轮答题现金红包"
,
priority
=
66
)
public
void
代理人领取第四轮答题现金红包
()
{
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
6
).
getQuesConfId
()
);
params
.
put
(
"optionId"
,
this
.
rightanswer
.
getId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
boolean
openResult
=
response
.
jsonPath
().
getBoolean
(
"data.openResult"
);
System
.
out
.
println
(
openResult
);
Assert
.
assertTrue
(
openResult
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"领取答题红包失败"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
response
.
body
().
asString
());
}
@Test
(
description
=
"代理人领取第四轮答题红包结果"
,
priority
=
67
)
public
void
代理人领取第四轮答题红包结果
()
{
agentAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
6
).
getQuesConfId
()
);
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"答题失败"
,
response
.
body
().
asString
()));
Object
amount
=
response
.
jsonPath
().
getJsonObject
(
"data.amount"
);
System
.
out
.
println
(
amount
);
Assert
.
assertNotNull
(
amount
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"领取失败"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
response
.
body
().
asString
());
}
/*上架主播端未发放的有奖答题-福利*/
@Test
(
description
=
"上架第四轮答题福利"
,
priority
=
68
)
public
void
上架第四轮答题福利
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
100000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
7
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardUp
,
"上架答题红包失败"
,
response
.
body
().
asString
()));
}
/*主播端发放福利类型的有奖答题*/
@Test
(
description
=
"发放第四轮答题福利"
,
priority
=
69
)
public
void
发放第四轮答题福利
()
{
adminAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"confId"
,
this
.
quesConfId
.
get
(
7
).
getQuesConfId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
);
boolean
data
=
response
.
jsonPath
().
getBoolean
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertTrue
(
data
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesRewardStart
,
"发放答题红包失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"访客查询第四轮答题福利"
,
priority
=
70
)
public
void
代理人查询第四轮答题福利
()
{
adminAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesDetail
);
List
<
QuestionList
.
question
>
list
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
response
.
jsonPath
().
get
(
"data.questionList"
)),
QuestionList
.
question
.
class
);
System
.
out
.
println
(
list
);
Optional
<
QuestionList
.
question
>
wrongAnswerOption
=
list
.
stream
().
filter
(
option
->
Objects
.
equals
(
option
.
getOptionType
(),
2
)).
findAny
();
this
.
wronganswer
=
wrongAnswerOption
.
get
();
Optional
<
QuestionList
.
question
>
correctAnswerOption
=
list
.
stream
().
filter
(
option
->
Objects
.
equals
(
option
.
getOptionType
(),
1
)).
findFirst
();
this
.
rightanswer
=
correctAnswerOption
.
get
();
System
.
out
.
println
(
list
);
Assert
.
assertNotNull
(
list
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"查询第四轮福利失败"
,
response
.
body
().
asString
()));
//校验该题目是否允许邀请,0为不支持
System
.
out
.
println
(
response
.
body
().
asString
());
boolean
supportInvite
=
response
.
jsonPath
().
getBoolean
(
"data.supportInvite"
);
System
.
out
.
println
(
supportInvite
);
Assert
.
assertFalse
(
supportInvite
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesDetail
,
"不支持邀请配置有误"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"代理人第四轮领取答题福利-答题正确"
,
priority
=
71
)
public
void
代理人第四轮领取答题福利
(){
agentAuth
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
7
).
getQuesConfId
());
params
.
put
(
"optionId"
,
this
.
rightanswer
.
getId
());
Response
response
=
network
.
postResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
);
System
.
out
.
println
(
response
);
boolean
openResult
=
response
.
jsonPath
().
getBoolean
(
"data.openResult"
);
Assert
.
assertTrue
(
openResult
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"参与失败"
,
response
.
body
().
asString
()));
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipate
,
"答题失败"
,
response
.
body
().
asString
()));
}
@Test
(
description
=
"查询代理人第四轮有奖答题福利类型结果"
,
priority
=
72
)
public
void
查询代理人第四轮有奖答题福利类型结果
(){
//验证管理后台配置实物奖品允许代理人参与并获奖
agentAuth
();
ThreadSleepUtils
.
sleep
(
3000
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
ENCODE_LIVE_ID
.
getKey
()));
params
.
put
(
"quesConfId"
,
this
.
quesConfId
.
get
(
7
).
getQuesConfId
());
Response
response
=
network
.
getResponse
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
);
System
.
out
.
println
(
response
);
boolean
result
=
response
.
jsonPath
().
getBoolean
(
"data.result"
);
System
.
out
.
println
(
result
);
Assert
.
assertTrue
(
result
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"答题失败"
,
response
.
body
().
asString
()));
Integer
welfareStatus
=
response
.
jsonPath
().
getJsonObject
(
"data.welfareStatus"
);
System
.
out
.
println
(
welfareStatus
);
Assert
.
assertTrue
(
welfareStatus
==
2
,
network
.
message
(
params
,
BasicConfig
.
MOBILE_QuesParticipateInfo
,
"领取异常"
,
response
.
body
().
asString
()));
System
.
out
.
println
(
response
.
body
().
asString
());
}
}
}
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