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
eb1da9fa
Commit
eb1da9fa
authored
Dec 03, 2018
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
8399d051
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
抽奖异常测试_DuibaTest.java
...est/java/http/cases/NewActivityTest/抽奖异常测试_DuibaTest.java
+4
-1
NewActivityService.java
src/test/java/http/service/Activity/NewActivityService.java
+19
-0
No files found.
src/test/java/http/cases/NewActivityTest/抽奖异常测试_DuibaTest.java
View file @
eb1da9fa
...
...
@@ -152,7 +152,10 @@ public class 抽奖异常测试_DuibaTest extends DuibaTestBase {
//获取未登录场景cookie
Response
responses
=
authorization
.
autoLogin
();
//进行接口测试传参
Response
response
=
newActivityService
.
doJoin
(
responses
.
getDetailedCookies
(),
data
.
get
(
"token"
),
data
.
get
(
"activityId"
));
Map
<
String
,
String
>
map
=
responses
.
getCookies
();
logger
.
info
(
"cookies:"
+
map
.
toString
());
Response
response
=
newActivityService
.
doJoinMap
(
map
,
data
.
get
(
"token"
),
data
.
get
(
"activityId"
));
// Response response = newActivityService.doJoin(responses.getDetailedCookies(),data.get("token"),data.get("activityId"));
response
.
prettyPrint
();
String
success
=
String
.
valueOf
(
response
.
jsonPath
().
getString
(
"success"
));
//根据case选择校验项
...
...
src/test/java/http/service/Activity/NewActivityService.java
View file @
eb1da9fa
...
...
@@ -80,6 +80,25 @@ public class NewActivityService {
}
return
response
;
}
public
Response
doJoinMap
(
Map
cookies
,
String
token
,
String
activityId
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"token"
,
token
);
map
.
put
(
"activityId"
,
activityId
);
map
.
put
(
"oaId"
,
activityId
);
logger
.
info
(
"请求/hdtool/doJoin接口,activityId="
+
activityId
);
logger
.
info
(
"url:"
+
url
+
"/hdtool/doJoin"
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
post
(
url
+
"/hdtool/doJoin"
);
try
{
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
getStatusCode
()),
"200"
);
logger
.
info
(
"/hdtool/doJoin接口成功,返回信息:"
+
response
.
asString
());
}
catch
(
Exception
e
){
throw
new
Exception
(
"/hdtool/doJoin接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/hdtool/doJoin接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
public
Response
doJoin2
(
String
activityId
,
String
token
)
throws
Exception
{
Map
<
String
,
String
>
map
=
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