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
a0235647
Commit
a0235647
authored
Dec 05, 2018
by
吕雯燕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'duiba_wenyan' into develop
parents
efb8a4b4
d4c2a34e
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
新建活动测试_DuibaTest.java
src/test/java/http/cases/DeveloperTest/新建活动测试_DuibaTest.java
+0
-0
DeveloperService.java
src/test/java/http/service/hd/DeveloperService.java
+62
-0
No files found.
src/test/java/http/cases/DeveloperTest/新建活动测试_DuibaTest.java
View file @
a0235647
This diff is collapsed.
Click to expand it.
src/test/java/http/service/hd/DeveloperService.java
View file @
a0235647
...
...
@@ -1110,4 +1110,66 @@ public class DeveloperService {
return
response
;
}
//保存自有答题活动--所有字段
public
Response
saveQuestion
(
String
title
,
String
awards
,
String
questionRecord
,
String
creditsType
,
String
freeLimit
,
String
freeScope
,
String
limitCount
,
String
limitScope
,
String
optionNum
)
throws
Exception
{
String
url
=
hdHost
+
"/question/save"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"subType"
,
"question"
);
map
.
put
(
"title"
,
title
);
map
.
put
(
"anticheatExchangeLimit"
,
"true"
);
map
.
put
(
"awards"
,
awards
);
map
.
put
(
"questionRecord"
,
questionRecord
);
map
.
put
(
"credits"
,
"22"
);
map
.
put
(
"creditsType"
,
creditsType
);
map
.
put
(
"banner"
,
"//yun.duiba.com.cn/upload/S2T4p1474356849960.png"
);
map
.
put
(
"thumbnail"
,
"//yun.duiba.com.cn/upload/ljoka1474356876322.png"
);
map
.
put
(
"bannerImgNew"
,
"//yun.duiba.com.cn/upload/qzfsmsyo9s.png"
);
map
.
put
(
"appId"
,
"2239"
);
map
.
put
(
"freeLimit"
,
freeLimit
);
map
.
put
(
"freeScope"
,
freeScope
);
map
.
put
(
"limitCount"
,
limitCount
);
map
.
put
(
"limitScope"
,
limitScope
);
map
.
put
(
"optionNum"
,
optionNum
);
map
.
put
(
"autoOffDate"
,
"2020-12-08 00:00"
);
map
.
put
(
"id"
,
""
);
logger
.
info
(
"创建自有答题活动:"
+
url
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLogin
()).
params
(
map
).
post
(
"http://"
+
url
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"成功"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"创建自有答题活动接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"创建自有答题活动接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
//编辑自有答题活动
public
Response
editQuestion
(
String
actId
)
throws
Exception
{
String
url
=
hdHost
+
"/question/editData"
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
"2239"
);
map
.
put
(
"actId"
,
actId
);
map
.
put
(
"type"
,
"question"
);
logger
.
info
(
"请求编辑自有答题活动url:"
+
url
);
Response
response
=
given
().
contentType
(
"application/x-www-form-urlencoded;charset=UTF-8"
).
cookies
(
authorization
.
hdLogin
()).
params
(
map
).
post
(
"http://"
+
url
);
response
.
prettyPrint
();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"desc"
),
"成功"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"编辑自有答题活动接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"编辑自有答题活动接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
}
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