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
59de9f7e
Commit
59de9f7e
authored
Dec 10, 2019
by
panyuli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权益一期测试点
parent
8bc22e79
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
权益一期线上用户核销中匹配兑换码兑换.java
...java/http/cases/equitySubjectTest/权益一期线上用户核销中匹配兑换码兑换.java
+0
-0
equityPrizeService.java
src/test/java/http/service/Activity/equityPrizeService.java
+51
-0
No files found.
src/test/java/http/cases/equitySubjectTest/权益一期线上用户核销中匹配兑换码兑换.java
0 → 100644
View file @
59de9f7e
This diff is collapsed.
Click to expand it.
src/test/java/http/service/Activity/equityPrizeService.java
0 → 100644
View file @
59de9f7e
package
http
.
service
.
Activity
;
import
http.service.Authorization
;
import
io.restassured.http.Cookies
;
import
io.restassured.response.Response
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.testng.Assert
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
io
.
restassured
.
RestAssured
.
given
;
@Service
public
class
equityPrizeService
{
@Value
(
"${activity.host}"
)
String
activityHost
;
@Autowired
Authorization
authorization
;
/**
* 核销一期 /aaw/equityPrize/exchange
* Request Method: POST
*
* @param excCode 兑换码
* @return
* @throws Exception
*/
public
Response
exchange
(
Map
cookies
,
String
excCode
,
String
validate
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"excCode"
,
excCode
);
map
.
put
(
"validate"
,
validate
);
Response
response
=
given
().
cookies
(
cookies
).
params
(
map
).
post
(
activityHost
+
"/aaw/equityPrize/exchange"
);
try
{
// Assert.assertEquals(response.jsonPath().getString("success"), "true", "/aaw/equityPrize/exchange接口失败");
Assert
.
assertEquals
(
String
.
valueOf
(
response
.
getStatusCode
()),
"200"
,
"/aaw/equityPrize/exchange接口失败"
);
}
catch
(
Exception
e
)
{
throw
new
Exception
(
"/aaw/equityPrize/exchange接口失败,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
)
{
throw
new
Exception
(
"/aaw/equityPrize/exchange接口失败,返回信息:"
+
response
.
asString
());
}
return
response
;
}
}
\ No newline at end of file
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