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
da1f6f2c
Commit
da1f6f2c
authored
Aug 20, 2021
by
xiamengchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增秒杀互动-管理后台配置秒杀轮次
parent
e68a02e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
SaveLive.java
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
+6
-6
No files found.
src/test/java/com/kjj/cases/live/liveConfig/SaveLive.java
View file @
da1f6f2c
...
...
@@ -2351,7 +2351,7 @@ public class SaveLive implements Authorization {
public
void
添加秒杀互动
()
{
Map
<
String
,
Object
>
secKillAddPar
=
new
HashMap
<>();
secKillAddPar
.
put
(
"goodsId"
,
secKillGoodsId
);
secKillAddPar
.
put
(
"goodsAmount"
,
0.01
);
secKillAddPar
.
put
(
"goodsAmount"
,
1
);
// 1 == 0.01
secKillAddPar
.
put
(
"interactNum"
,
3
);
secKillAddPar
.
put
(
"ableAgent"
,
0
);
// 代理人不可参与
secKillAddPar
.
put
(
"liveId"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
...
...
@@ -2373,8 +2373,8 @@ public class SaveLive implements Authorization {
Response
liveSecKillRes
=
network
.
getResponse
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
);
List
<
SecondKillList
>
secondKillLists
;
try
{
secondKillLists
=
JsonUtil
.
parseResponseTo
Page
Bean
(
liveSecKillRes
,
SecondKillList
.
class
);
}
catch
(
JsonParse
Exception
e
){
secondKillLists
=
JsonUtil
.
parseResponseTo
List
Bean
(
liveSecKillRes
,
SecondKillList
.
class
);
}
catch
(
Exception
e
){
System
.
out
.
println
(
liveSecKillRes
.
body
().
asString
());
e
.
printStackTrace
();
return
;
...
...
@@ -2383,9 +2383,9 @@ public class SaveLive implements Authorization {
long
goodsId
=
secondKillList
.
getGoodsId
();
Assert
.
assertEquals
(
goodsId
,
secKillGoodsId
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品id与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
int
goodsAmount
=
secondKillList
.
getGoodsAmount
();
Assert
.
assertEquals
(
goodsAmount
,
0.0
1
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品价格与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
Assert
.
assertEquals
(
goodsAmount
,
1
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品价格与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
String
goodsTitle
=
secondKillList
.
getGoodsTitle
();
Assert
.
assertEquals
(
goodsTitle
,
LiveMaterial
.
skGoodsTitle
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品名称与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
Assert
.
assertEquals
(
goodsTitle
,
"自动化专用商品"
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品名称与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
int
interactNum
=
secondKillList
.
getInteractNum
();
Assert
.
assertEquals
(
interactNum
,
3
,
network
.
message
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
,
"商品数量与实际添加的不符"
,
liveSecKillRes
.
body
().
asString
()));
int
surplusNum
=
secondKillList
.
getSurplusNum
();
...
...
@@ -2427,7 +2427,7 @@ public class SaveLive implements Authorization {
Response
liveSecKillRes
=
network
.
getResponse
(
liveSecKillPar
,
BasicConfig
.
MANAGER_secondKillLists
);
List
<
SecondKillList
>
secondKillLists
=
null
;
try
{
secondKillLists
=
JsonUtil
.
parseResponseTo
Page
Bean
(
liveSecKillRes
,
SecondKillList
.
class
);
secondKillLists
=
JsonUtil
.
parseResponseTo
List
Bean
(
liveSecKillRes
,
SecondKillList
.
class
);
}
catch
(
NullPointerException
e
){
e
.
printStackTrace
();
}
...
...
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