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
ec4bfb9d
Commit
ec4bfb9d
authored
Nov 26, 2018
by
钱雯君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
77052a56
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
pk_开奖_瓜分红包测试.java
src/test/java/http/cases/PkTest/pk_开奖_瓜分红包测试.java
+0
-0
PkActivityService.java
src/test/java/http/service/Manager/PkActivityService.java
+50
-0
No files found.
src/test/java/http/cases/PkTest/pk_开奖_瓜分红包测试.java
View file @
ec4bfb9d
This diff is collapsed.
Click to expand it.
src/test/java/http/service/Manager/PkActivityService.java
View file @
ec4bfb9d
...
@@ -13,6 +13,9 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -13,6 +13,9 @@ import com.alibaba.fastjson.JSONObject;
import
http.model.BetOptionVo
;
import
http.model.BetOptionVo
;
import
http.service.Authorization
;
import
http.service.Authorization
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -46,6 +49,7 @@ public class PkActivityService {
...
@@ -46,6 +49,7 @@ public class PkActivityService {
public
Response
bet
(
String
bonusType
,
String
endTime
)
throws
Exception
{
public
Response
bet
(
String
bonusType
,
String
endTime
)
throws
Exception
{
String
url
=
"http://"
+
ManagerHost
+
"/newmanager/bet"
;
String
url
=
"http://"
+
ManagerHost
+
"/newmanager/bet"
;
List
<
BetOptionVo
>
betOptionVoList
=
new
ArrayList
<>();
List
<
BetOptionVo
>
betOptionVoList
=
new
ArrayList
<>();
BetOptionVo
betOptionVo1
=
new
BetOptionVo
();
BetOptionVo
betOptionVo1
=
new
BetOptionVo
();
BetOptionVo
betOptionVo2
=
new
BetOptionVo
();
BetOptionVo
betOptionVo2
=
new
BetOptionVo
();
...
@@ -87,6 +91,52 @@ public class PkActivityService {
...
@@ -87,6 +91,52 @@ public class PkActivityService {
}
}
public
Response
betForSetUp
(
String
bonusType
,
String
endTime
)
throws
Exception
{
String
url
=
"http://"
+
ManagerHost
+
"/newmanager/bet"
;
DateTime
date
=
new
DateTime
();
DateTimeFormatter
formatter
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd HH:mm:ss"
);
String
time
=
formatter
.
print
(
date
.
getMillis
()).
toString
();
List
<
BetOptionVo
>
betOptionVoList
=
new
ArrayList
<>();
BetOptionVo
betOptionVo1
=
new
BetOptionVo
();
BetOptionVo
betOptionVo2
=
new
BetOptionVo
();
betOptionVo1
.
setOptionImg
(
"//yun.dui88.com/images/201807/6pyca34t5e.jpeg"
);
betOptionVo1
.
setOptionName
(
"【自动化】选项A1"
);
betOptionVo2
.
setOptionImg
(
"//yun.dui88.com/images/201807/kcrl1q7hkt.jpeg"
);
betOptionVo2
.
setOptionName
(
"【自动化】选项A2"
);
betOptionVoList
.
add
(
betOptionVo1
);
betOptionVoList
.
add
(
betOptionVo2
);
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
para
.
put
(
"betOptionDtoList"
,
betOptionVoList
);
para
.
put
(
"betType"
,
"1"
);
//1-单选单次;
para
.
put
(
"bonusType"
,
bonusType
);
//1-经验;2-红包
if
(
bonusType
.
equals
(
"2"
)){
para
.
put
(
"bonusAmount"
,
"0.1"
);
//实际瓜分红包金额
para
.
put
(
"title"
,
"【自动化】瓜分红包"
+
time
);
}
else
{
para
.
put
(
"title"
,
"【自动化】瓜分经验"
+
time
);
}
para
.
put
(
"configStatus"
,
"1"
);
para
.
put
(
"creditsValue"
,
"1"
);
para
.
put
(
"endTime"
,
endTime
);
para
.
put
(
"shareExp"
,
"13"
);
JSONObject
jsonParam
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
para
));
Response
betResponse
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
ssoLogin
()).
body
(
jsonParam
).
post
(
url
);
betResponse
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
betResponse
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"创建pk活动接口失败,返回信息:"
+
betResponse
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"创建pk活动接口失败,返回信息:"
+
betResponse
.
asString
());
}
return
betResponse
;
}
public
Response
betGroupRelation
(
String
betId
,
String
endTime
,
String
groupId
)
throws
Exception
{
public
Response
betGroupRelation
(
String
betId
,
String
endTime
,
String
groupId
)
throws
Exception
{
String
url
=
"http://"
+
ManagerHost
+
"/newmanager/betGroupRelation"
;
String
url
=
"http://"
+
ManagerHost
+
"/newmanager/betGroupRelation"
;
...
...
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