Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-sportstest
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-sportstest
Commits
d9dea080
Commit
d9dea080
authored
Jul 31, 2024
by
DuJunLi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
4162e588
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
src/main/java/com/xiaomai/cases/polar/coupon/CouponTools.java
+15
-5
No files found.
src/main/java/com/xiaomai/cases/polar/coupon/CouponTools.java
View file @
d9dea080
...
@@ -9,6 +9,7 @@ import com.xiaomai.enums.Terminal;
...
@@ -9,6 +9,7 @@ import com.xiaomai.enums.Terminal;
import
com.xiaomai.utils.CommUtil
;
import
com.xiaomai.utils.CommUtil
;
import
com.xiaomai.utils.XMJSONPath
;
import
com.xiaomai.utils.XMJSONPath
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.testng.Assert
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -97,7 +98,8 @@ public class CouponTools extends BaseTestImpl {
...
@@ -97,7 +98,8 @@ public class CouponTools extends BaseTestImpl {
body
.
put
(
"memo"
,
memo
);
body
.
put
(
"memo"
,
memo
);
}
}
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
return
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result"
);
return
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.result"
);
}
}
...
@@ -150,7 +152,9 @@ public class CouponTools extends BaseTestImpl {
...
@@ -150,7 +152,9 @@ public class CouponTools extends BaseTestImpl {
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"id"
,
couponId
);
body
.
put
(
"id"
,
couponId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
}
/**
/**
...
@@ -166,7 +170,9 @@ public class CouponTools extends BaseTestImpl {
...
@@ -166,7 +170,9 @@ public class CouponTools extends BaseTestImpl {
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"id"
,
couponId
);
body
.
put
(
"id"
,
couponId
);
body
.
put
(
"inventory"
,
inventory
);
body
.
put
(
"inventory"
,
inventory
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
}
...
@@ -203,7 +209,9 @@ public class CouponTools extends BaseTestImpl {
...
@@ -203,7 +209,9 @@ public class CouponTools extends BaseTestImpl {
if
(
status
.
isEmpty
()){
if
(
status
.
isEmpty
()){
body
.
put
(
"status"
,
null
);
body
.
put
(
"status"
,
null
);
}
}
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
}
/**
/**
...
@@ -235,7 +243,9 @@ public class CouponTools extends BaseTestImpl {
...
@@ -235,7 +243,9 @@ public class CouponTools extends BaseTestImpl {
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"id"
,
recordId
);
body
.
put
(
"id"
,
recordId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
);
Assert
.
assertTrue
(
Boolean
.
valueOf
(
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.success"
))==
true
,
"调用接口返回结果:"
+
XMJSONPath
.
readPath
(
dataApi
.
getApi_response
(),
"$.message"
));
}
}
}
}
...
...
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