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
ee6c3bcc
Commit
ee6c3bcc
authored
Dec 05, 2018
by
钱雯君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
0f63bc1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
pk_开奖_瓜分优惠券_AccessTest.java
src/test/java/http/cases/PkTest/pk_开奖_瓜分优惠券_AccessTest.java
+1
-1
pk_押注测试_AccessTest.java
src/test/java/http/cases/PkTest/pk_押注测试_AccessTest.java
+45
-0
No files found.
src/test/java/http/cases/PkTest/pk_开奖_瓜分优惠券.java
→
src/test/java/http/cases/PkTest/pk_开奖_瓜分优惠券
_AccessTest
.java
View file @
ee6c3bcc
...
@@ -38,7 +38,7 @@ import java.util.Map;
...
@@ -38,7 +38,7 @@ import java.util.Map;
* @create 2018/8/9
* @create 2018/8/9
* @since 1.0.0
* @since 1.0.0
*/
*/
public
class
pk_
开奖
_
瓜分优惠券
extends
DuibaTestBase
{
public
class
pk_
开奖
_
瓜分优惠券
_AccessTest
extends
DuibaTestBase
{
@Autowired
@Autowired
PkService
pkService
;
PkService
pkService
;
...
...
src/test/java/http/cases/PkTest/pk_押注测试_AccessTest.java
View file @
ee6c3bcc
...
@@ -10,7 +10,9 @@ package http.cases.PkTest;
...
@@ -10,7 +10,9 @@ package http.cases.PkTest;
import
base.DuibaLog
;
import
base.DuibaLog
;
import
base.DuibaTestBase
;
import
base.DuibaTestBase
;
import
com.alibaba.fastjson.JSONObject
;
import
http.service.Activity.PkService
;
import
http.service.Activity.PkService
;
import
http.service.Manager.EditManagerInfoService
;
import
http.service.hd.DeveloperConfigService
;
import
http.service.hd.DeveloperConfigService
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -19,8 +21,10 @@ import org.testng.Assert;
...
@@ -19,8 +21,10 @@ import org.testng.Assert;
import
org.testng.annotations.AfterMethod
;
import
org.testng.annotations.AfterMethod
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
org.testng.annotations.Test
;
import
utils.GetCookieUtil
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -38,6 +42,10 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
...
@@ -38,6 +42,10 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
PkService
pkService
;
PkService
pkService
;
@Autowired
@Autowired
DeveloperConfigService
developerConfigService
;
DeveloperConfigService
developerConfigService
;
@Autowired
EditManagerInfoService
editManagerInfoService
;
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
private
DuibaLog
logger
=
DuibaLog
.
getLogger
();
...
@@ -47,6 +55,7 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
...
@@ -47,6 +55,7 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
private
static
String
uid02_consumerId
=
"100066016"
;
private
static
String
uid02_consumerId
=
"100066016"
;
private
String
consumerIds
=
""
;
private
List
<
String
>
orderIds
=
new
ArrayList
<>();
private
List
<
String
>
orderIds
=
new
ArrayList
<>();
...
@@ -143,6 +152,40 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
...
@@ -143,6 +152,40 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
}
}
@Test
public
void
押注
_
新用户首次参与测试
()
throws
Exception
{
Map
<
String
,
String
>
user
=
this
.
createUser
();
consumerIds
=
user
.
get
(
"consumerId"
);
logger
.
info
(
"consumerIds的信息为"
+
consumerIds
);
Response
doJoinResponse
=
pkService
.
doJoin2
(
Integer
.
valueOf
(
user
.
get
(
"uid"
)),
"124"
,
"248"
);
doJoinResponse
.
prettyPrint
();
Assert
.
assertEquals
(
doJoinResponse
.
jsonPath
().
getString
(
"code"
).
toString
(),
"100060"
);
}
public
Map
<
String
,
String
>
createUser
()
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Response
response
=
editManagerInfoService
.
createUser
(
"pk活动首次参与用户"
);
Map
<
String
,
Object
>
user
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where name = 'pk活动首次参与用户' and app_id = '67'\n"
);
String
uid
=
user
.
get
(
"id"
).
toString
();
String
url
=
GetCookieUtil
.
genUrl
(
uid
,
"3erv8LvBxKBSyuGK5i8FSGyYoFD1"
);
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 = '67'"
);
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
);
}
@AfterMethod
@AfterMethod
public
void
tearDown
()
{
public
void
tearDown
()
{
...
@@ -152,6 +195,8 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
...
@@ -152,6 +195,8 @@ public class pk_押注测试_AccessTest extends DuibaTestBase {
for
(
String
orderId:
orderIds
){
for
(
String
orderId:
orderIds
){
Boolean
result2
=
jdbc
.
update
(
"delete from activity_order_con.tb_trade_center_activity_order_0735 where order_num = ?\n"
,
orderId
);
Boolean
result2
=
jdbc
.
update
(
"delete from activity_order_con.tb_trade_center_activity_order_0735 where order_num = ?\n"
,
orderId
);
}
}
clear
(
consumerIds
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
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