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
c09742b9
Commit
c09742b9
authored
Mar 06, 2019
by
赵然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zr
parent
e30d4d17
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
149 additions
and
7 deletions
+149
-7
瓜分积分_实际瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_AccessTest.java
+1
-1
瓜分积分_实际瓜分_主胜方_AccessTest.java
...ava/http/cases/PkMoudleTest/瓜分积分_实际瓜分_主胜方_AccessTest.java
+1
-1
瓜分红包_实际瓜分_AccessTest.java
...st/java/http/cases/PkMoudleTest/瓜分红包_实际瓜分_AccessTest.java
+17
-3
PkDevelopService.java
src/test/java/http/service/hd/PkDevelopService.java
+130
-2
No files found.
src/test/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_AccessTest.java
View file @
c09742b9
...
...
@@ -257,7 +257,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Boolean
result5
=
jdbc
.
update
(
"delete from bet_activity.tb_bet_result where bet_id = ?"
,
betId
);
Boolean
result2
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_group_relation where bet_id = ?"
,
betId
);
Boolean
result3
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_config where id = ?"
,
betId
);
Boolean
result6
=
jdbc
.
update
(
"delete from credits.operating_activity where type = 53 and app_id = 21827"
);
Boolean
result6
=
jdbc
.
update
(
"delete from credits
_dev
.operating_activity where type = 53 and app_id = 21827"
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
...
...
src/test/java/http/cases/PkMoudleTest/瓜分积分_实际瓜分_主胜方_AccessTest.java
View file @
c09742b9
...
...
@@ -263,7 +263,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas
Boolean
result5
=
jdbc
.
update
(
"delete from bet_activity.tb_bet_result where bet_id = ?"
,
betId
);
Boolean
result2
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_group_relation where bet_id = ?"
,
betId
);
Boolean
result3
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_config where id = ?"
,
betId
);
Boolean
result6
=
jdbc
.
update
(
"delete from credits.operating_activity where type = 53 and app_id = 21832"
);
Boolean
result6
=
jdbc
.
update
(
"delete from credits
_dev
.operating_activity where type = 53 and app_id = 21832"
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
...
...
src/test/java/http/cases/PkMoudleTest/瓜分红包_
作弊瓜分
.java
→
src/test/java/http/cases/PkMoudleTest/瓜分红包_
实际瓜分_AccessTest
.java
View file @
c09742b9
...
...
@@ -29,7 +29,7 @@ import java.text.DecimalFormat;
import
java.util.Map
;
public
class
瓜分红包
_
作弊瓜分
extends
DuibaTestBase
{
public
class
瓜分红包
_
实际瓜分
_AccessTest
extends
DuibaTestBase
{
@Autowired
PkDevelopService
pkDevelopService
;
...
...
@@ -50,7 +50,17 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase {
@Test
public
void
创建
PK
活动
()
throws
Exception
{
Response
response
=
pkDevelopService
.
betEditor
(
"21829"
,
"1"
,
"2"
,
"0.01"
,
"0"
,
"10"
);
logger
.
info
(
"开始生成预算token"
);
Response
response
=
pkDevelopService
.
temporaryCard
(
"21829"
,
"2"
,
"5"
,
"10"
,
"2019-03-04T16:00:00.000Z"
,
"2029-03-22T16:00:00.000Z"
);
String
token
=
response
.
jsonPath
().
getString
(
"data.checkUuid"
);
logger
.
info
(
"生成预算token为:"
+
token
);
pkDevelopService
.
preSaveCheck
(
"21829"
,
token
);
logger
.
info
(
"预算确认成功!"
);
response
=
pkDevelopService
.
betEditor_red
(
"21829"
,
token
,
"1"
,
"2"
,
"0.01"
,
"0"
,
"10"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"成功"
,
"创建组件化pk_分红包活动失败"
);
response
=
pkService
.
getBetList
(
uid1
);
...
...
@@ -188,7 +198,9 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase {
public
void
出奖弹层校验
()
throws
Exception
{
Response
response
=
pkService
.
popup
(
uid1
);
response
.
prettyPrint
();
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.prizeList[0].totalBonus"
),
"1"
,
"中奖弹窗积分校验失败"
);
// Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].totalBonus"),"1","中奖弹窗积分校验失败");
Assert
.
assertTrue
(
new
BigDecimal
(
response
.
jsonPath
().
getString
(
"data.prizeList[0].totalBonus"
)).
compareTo
(
new
BigDecimal
(
"1"
))==
0
,
"中奖弹窗积分校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.prizeList[0].bonusType"
),
"2"
,
"中奖弹窗类型校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.totalBonus"
),
"0.01"
,
"中奖弹窗积分校验失败"
);
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"data.show"
),
"true"
,
"展示弹窗校验失败"
);
...
...
@@ -251,6 +263,8 @@ public class 瓜分红包_作弊瓜分 extends DuibaTestBase {
Boolean
result5
=
jdbc
.
update
(
"delete from bet_activity.tb_bet_result where bet_id = ?"
,
betId
);
Boolean
result2
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_group_relation where bet_id = ?"
,
betId
);
Boolean
result3
=
jdbc
.
update
(
"delete from act_com_conf.tb_bet_config where id = ?"
,
betId
);
Boolean
result6
=
jdbc
.
update
(
"delete from credits_dev.operating_activity where type = 53 and app_id = 21829"
);
Boolean
result7
=
jdbc
.
update
(
"delete from act_com_conf.tb_red_account_period where app_id = 21829"
);
}
catch
(
SQLException
e
)
{
e
.
printStackTrace
();
}
catch
(
Exception
e
){
...
...
src/test/java/http/service/hd/PkDevelopService.java
View file @
c09742b9
...
...
@@ -40,6 +40,7 @@ public class PkDevelopService {
@Autowired
Authorization
authorization
;
public
Response
betEditor
(
String
appId
,
String
bonusType
,
String
questionType
,
String
bonusAmount
,
String
creditsValue
,
String
shareExp
)
throws
Exception
{
String
data
=
PublicMethod
.
data
();
...
...
@@ -83,8 +84,8 @@ public class PkDevelopService {
betDevelopVoList
.
add
(
betDevelopVo
);
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
para
.
put
(
"bonusAccount"
,
bonusAmount
);
para
.
put
(
"bonusType"
,
bonusType
);
//
2-瓜分积分
para
.
put
(
"bonusAccount"
,
"1"
);
para
.
put
(
"bonusType"
,
bonusType
);
//
1-瓜分红包,2-瓜分积分,
para
.
put
(
"periodStartTime"
,
"2019-03-04T16:00:00.000Z"
);
para
.
put
(
"periodEndTime"
,
"2029-03-22T16:00:00.000Z"
);
para
.
put
(
"rules"
,
"自动化规则自动化规则"
);
...
...
@@ -174,6 +175,133 @@ public class PkDevelopService {
return
betResponse
;
}
public
Response
betEditor_red
(
String
appId
,
String
checkUuid
,
String
bonusType
,
String
questionType
,
String
bonusAmount
,
String
creditsValue
,
String
shareExp
)
throws
Exception
{
String
data
=
PublicMethod
.
data
();
//String url = "http://" + hdHost + "/visual-editor/bet/post";
String
url
=
"http://"
+
hdHost
+
"/visual-editor/bet/save"
;
//创建投注项
List
<
BetOptionVo
>
betOptionVoList
=
new
ArrayList
<>();
BetOptionVo
betOptionVo1
=
new
BetOptionVo
();
BetOptionVo
betOptionVo2
=
new
BetOptionVo
();
betOptionVo1
.
setOptionImg
(
"//yun.dui88.com/images/201812/75j84chnkg.jpg"
);
betOptionVo1
.
setOptionName
(
"1"
);
betOptionVo1
.
setRightAnswer
(
null
);
betOptionVo2
.
setOptionImg
(
"//yun.dui88.com/images/201812/4f51vmzfpu.png"
);
betOptionVo2
.
setOptionName
(
"2"
);
betOptionVo2
.
setRightAnswer
(
null
);
betOptionVoList
.
add
(
betOptionVo1
);
betOptionVoList
.
add
(
betOptionVo2
);
//创建活动配置
List
<
BetDevelopVo
>
betDevelopVoList
=
new
ArrayList
<>();
BetDevelopVo
betDevelopVo
=
new
BetDevelopVo
();
betDevelopVo
.
setBetOptionDtoList
(
betOptionVoList
);
betDevelopVo
.
setBetType
(
"1"
);
betDevelopVo
.
setBonusAmount
(
bonusAmount
);
betDevelopVo
.
setBonusType
(
questionType
);
betDevelopVo
.
setConfigStatus
(
"3"
);
betDevelopVo
.
setCreditsValue
(
creditsValue
);
betDevelopVo
.
setDelayHours
(
"2"
);
betDevelopVo
.
setEndTime
(
""
);
betDevelopVo
.
setIsHover
(
"false"
);
betDevelopVo
.
setPopoverVisible
(
"false"
);
betDevelopVo
.
setShareExp
(
shareExp
);
if
(
questionType
.
equals
(
"2"
)){
betDevelopVo
.
setTitle
(
"【自动化】组件pk_瓜分红包"
+
data
);
}
else
if
(
questionType
.
equals
(
"4"
)){
betDevelopVo
.
setTitle
(
"【自动化】组件pk_瓜分积分"
+
data
);
}
betDevelopVoList
.
add
(
betDevelopVo
);
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
para
.
put
(
"bonusAccount"
,
"1"
);
para
.
put
(
"bonusAmount"
,
"5"
);
para
.
put
(
"bonusSizeLimit"
,
"10"
);
para
.
put
(
"bonusType"
,
bonusType
);
//1-瓜分红包,2-瓜分积分,
para
.
put
(
"checkUuid"
,
checkUuid
);
para
.
put
(
"periodStartTime"
,
"2019-03-04T16:00:00.000Z"
);
para
.
put
(
"periodEndTime"
,
"2029-03-22T16:00:00.000Z"
);
para
.
put
(
"rules"
,
"自动化规则自动化规则"
);
para
.
put
(
"timeType"
,
"create"
);
para
.
put
(
"title"
,
"组件pk自动化"
);
para
.
put
(
"list"
,
betDevelopVoList
);
JSONObject
jsonParam
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
para
));
Response
betResponse
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
(
appId
)).
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
;
}
/**
*
* @param appId
* @param bizType 活动类型 2-pk
* @param bonusAmount 活动单用户金额上限
* @param bonusSizeLimit 中奖人数
* @param periodStartTime 周期开始时间
* @param periodEndTime 周期结束时间
* @return
* @throws Exception
*/
public
Response
temporaryCard
(
String
appId
,
String
bizType
,
String
bonusAmount
,
String
bonusSizeLimit
,
String
periodStartTime
,
String
periodEndTime
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"/visual-editor/bet/temporaryCard"
;
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
para
.
put
(
"beforePeriodId"
,
""
);
para
.
put
(
"bizType"
,
bizType
);
para
.
put
(
"bonusAmount"
,
bonusAmount
);
para
.
put
(
"bonusSizeLimit"
,
bonusSizeLimit
);
para
.
put
(
"periodStartTime"
,
periodStartTime
);
para
.
put
(
"periodEndTime"
,
periodEndTime
);
para
.
put
(
"relId"
,
""
);
Response
Response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
(
appId
)).
body
(
para
).
post
(
url
);
Response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
Response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"预算生成token接口失败,返回信息:"
+
Response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"预算生成token接口失败,返回信息:"
+
Response
.
asString
());
}
return
Response
;
}
public
Response
preSaveCheck
(
String
appId
,
String
preCheckCode
)
throws
Exception
{
String
url
=
"http://"
+
hdHost
+
"/visual-editor/bet/preSaveCheck"
;
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
para
.
put
(
"preCheckCode"
,
preCheckCode
);
Response
Response
=
given
().
contentType
(
"application/json;charset=UTF-8"
).
cookies
(
authorization
.
hdLoginSaas
(
appId
)).
body
(
para
).
post
(
url
);
Response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
Response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"确认预算接口失败,返回信息:"
+
Response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"确认预算token接口失败,返回信息:"
+
Response
.
asString
());
}
return
Response
;
}
public
Response
doDraw
()
throws
Exception
{
String
url
=
"http://"
+
ManagerHost
+
"/newmanager/betOpenPrize/doDraw"
;
Map
<
String
,
Object
>
para
=
new
HashMap
<>();
...
...
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