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
175c5d47
Commit
175c5d47
authored
Dec 22, 2018
by
qwj-github
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
1e7f8a1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
1 deletion
+62
-1
pk_押注测试_AccessTest.java
src/test/java/http/cases/PkTest/pk_押注测试_AccessTest.java
+1
-0
pk_瓜分红包_发券测试.java
src/test/java/http/cases/PkTest/pk_瓜分红包_发券测试.java
+61
-1
No files found.
src/test/java/http/cases/PkTest/pk_押注测试_AccessTest.java
View file @
175c5d47
...
...
@@ -306,6 +306,7 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
doJoinResponse
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse
.
jsonPath
().
getString
(
"code"
).
toString
(),
"100060"
);
clear
(
consumerIds
);
}
...
...
src/test/java/http/cases/PkTest/pk_瓜分红包_发券测试.java
View file @
175c5d47
...
...
@@ -12,15 +12,19 @@ import base.DuibaTestBase;
import
com.alibaba.fastjson.JSONObject
;
import
http.model.PkPopPrizeVo
;
import
http.service.Activity.PkService
;
import
http.service.Manager.EditManagerInfoService
;
import
http.service.Manager.PkActivityService
;
import
http.service.hd.DeveloperConfigService
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.Test
;
import
utils.GetCookieUtil
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -38,6 +42,12 @@ public class pk_瓜分红包_发券测试 extends DuibaTestBase {
PkService
pkService
;
@Autowired
PkActivityService
pkActivityService
;
@Autowired
DeveloperConfigService
developerConfigService
;
@Autowired
EditManagerInfoService
editManagerInfoService
;
private
static
DuibaLog
logger
=
DuibaLog
.
getLogger
();
...
...
@@ -52,6 +62,7 @@ public class pk_瓜分红包_发券测试 extends DuibaTestBase {
// private Integer user04 = 5450;//appid=21982
List
<
String
>
newBetIds
=
new
ArrayList
<>();
private
String
consumerIds
=
""
;
...
...
@@ -109,6 +120,30 @@ public class pk_瓜分红包_发券测试 extends DuibaTestBase {
}
}
@Test
public
void
押注
_
新用户首次参与测试
()
throws
Exception
{
Map
<
String
,
String
>
user
=
this
.
createUser
();
consumerIds
=
user
.
get
(
"consumerId"
);
logger
.
info
(
"consumerIds的信息为"
+
consumerIds
);
String
newBetId
=
""
;
List
<
String
>
optionsIds
=
new
ArrayList
<>();
String
groupId
=
"200"
;
newBetId
=
createPk
(
"2"
,
"2020-08-12 00:00:00"
,
groupId
);
newBetIds
.
add
(
newBetId
);
List
<
Map
<
String
,
Object
>>
pks
=
jdbc
.
findModeResult
(
"select * from act_com_conf.tb_bet_option where bet_id = ?"
,
newBetId
);
logger
.
info
(
"pk活动信息为"
+
JSONObject
.
toJSONString
(
pks
));
for
(
int
i
=
0
;
i
<
pks
.
size
();
i
++){
optionsIds
.
add
(
pks
.
get
(
i
).
get
(
"id"
).
toString
());
}
logger
.
info
(
"pk活动id为:"
+
newBetId
+
",选项id为:"
+
optionsIds
.
toString
());
Response
doJoinResponse
=
pkService
.
doJoin2
(
Integer
.
valueOf
(
user
.
get
(
"uid"
)),
newBetId
,
optionsIds
.
get
(
0
));
doJoinResponse
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse
.
jsonPath
().
getString
(
"code"
).
toString
(),
"100060"
);
}
public
String
createPk
(
String
bounsType
,
String
endTime
,
String
groupId
)
throws
Exception
{
...
...
@@ -132,7 +167,30 @@ public class pk_瓜分红包_发券测试 extends DuibaTestBase {
}
@AfterClass
public
Map
<
String
,
String
>
createUser
()
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Response
response
=
editManagerInfoService
.
createUser
(
"pk活动首次参与用户发券"
,
"103"
);
Map
<
String
,
Object
>
user
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where name = 'pk活动首次参与用户发券' and app_id = '103'\n"
);
String
uid
=
user
.
get
(
"id"
).
toString
();
String
url
=
GetCookieUtil
.
genUrl
(
uid
,
"3NhqvHsNBDfcAJBUvdxmAs8mHq2d"
);
JSONObject
cookie
=
GetCookieUtil
.
getConsumerIdFromCookie
(
url
);
map
.
put
(
"uid"
,
uid
);
map
.
put
(
"consumerId"
,
cookie
.
get
(
"cid"
).
toString
());
logger
.
info
(
"用户信息为,uid="
+
uid
+
"consumerId="
+
cookie
.
get
(
"cid"
).
toString
());
return
map
;
}
public
void
clear
(
String
comsumerIds
)
throws
Exception
{
Boolean
res
=
jdbc
.
update
(
"delete from dafuweng.user where name = 'pk活动首次参与用户' and app_id = '103'"
);
String
dbName
=
"new_consumer.consumer_"
+
String
.
format
(
"%04d"
,
Long
.
parseLong
(
comsumerIds
)/
10000000
);
logger
.
info
(
"用户的分表名dbName为"
+
dbName
);
Boolean
res1
=
jdbc
.
update
(
"delete from "
+
dbName
+
" where id = ?"
,
comsumerIds
);
}
// @AfterClass
public
void
tearDown
()
{
try
{
...
...
@@ -146,6 +204,8 @@ public class pk_瓜分红包_发券测试 extends DuibaTestBase {
}
clear
(
consumerIds
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
){
...
...
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