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
999c5105
Commit
999c5105
authored
Mar 28, 2019
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4289696d
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
9 deletions
+103
-9
DingdingResult.java
src/test/java/base/DingdingResult.java
+9
-2
GitlabUtils.java
src/test/java/base/GitlabUtils.java
+3
-5
自有新优惠券_兑换限制测试.java
...java/http/cases/ExchangeTest/自有_商品兑换限制/自有新优惠券_兑换限制测试.java
+0
-0
自有新卡密_兑换限制测试.java
.../java/http/cases/ExchangeTest/自有_商品兑换限制/自有新卡密_兑换限制测试.java
+0
-0
自有新虚拟商品_充值_兑换限制.java
...va/http/cases/ExchangeTest/自有_商品兑换限制/自有新虚拟商品_充值_兑换限制.java
+0
-0
gawService.java
src/test/java/http/service/app/gawService.java
+91
-2
No files found.
src/test/java/base/DingdingResult.java
View file @
999c5105
...
...
@@ -7,6 +7,7 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.core.env.Environment
;
import
java.io.FileNotFoundException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.*
;
...
...
@@ -62,8 +63,14 @@ public class DingdingResult {
changes
=
Postman
.
sendFindTestApp
(
params
);
}
gitlabProjectMerges
=
GitlabUtils
.
getMessage
(
"credits-group"
,
changes
);
changes
=
changes
+
" 提交者:"
+
gitlabProjectMerges
.
getAuthor
().
getName
()+
" 描述:"
+
gitlabProjectMerges
.
getDescription
();
try
{
gitlabProjectMerges
=
GitlabUtils
.
getMessage
(
"credits-group"
,
changes
);
changes
=
changes
+
" 提交者:"
+
gitlabProjectMerges
.
getAuthor
().
getName
()+
" 描述:"
+
gitlabProjectMerges
.
getDescription
();
}
catch
(
Exception
e
){
logger
.
info
(
"不是兑吧服务,未发现变革"
);
}
this
.
total
=
total
;
...
...
src/test/java/base/GitlabUtils.java
View file @
999c5105
...
...
@@ -14,15 +14,13 @@ import java.util.List;
public
class
GitlabUtils
{
public
static
final
String
GIT_URL
=
"http://gitlab2.dui88.com"
;
public
static
final
String
SECRET
=
"rCyBy1sQ-JckquyFmo4c"
;
public
static
GitlabProjectMerges
getMessage
(
String
namespace
,
String
projectname
){
public
static
GitlabProjectMerges
getMessage
(
String
namespace
,
String
projectname
)
throws
IOException
{
GitlabAPI
gitlabAPI
=
GitlabAPI
.
connect
(
GitlabUtils
.
GIT_URL
,
GitlabUtils
.
SECRET
);
GitlabProject
gitlabProject
=
null
;
try
{
gitlabProject
=
gitlabAPI
.
getProject
(
namespace
,
projectname
);
// gitlabProject = gitlabAPI.getProject("credits-group","hdtool-web");
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
GitabProjectLatelyChangeQry
qry
=
new
GitabProjectLatelyChangeQry
();
qry
.
setId
(
gitlabProject
.
getId
());
...
...
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新优惠券_兑换限制测试.java
View file @
999c5105
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新卡密_兑换限制测试.java
0 → 100644
View file @
999c5105
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/ExchangeTest/自有_商品兑换限制/自有新虚拟商品_充值_兑换限制.java
0 → 100644
View file @
999c5105
This diff is collapsed.
Click to expand it.
src/test/java/http/service/app/gawService.java
View file @
999c5105
...
...
@@ -110,9 +110,9 @@ public class gawService {
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/gaw/
object
Exchange/create接口返回异常,返回信息:"
+
response
.
asString
());
throw
new
Exception
(
"/gaw/
coupon
Exchange/create接口返回异常,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/gaw/
object
Exchange/create接口返回异常,返回信息:"
+
response
.
asString
());
throw
new
Exception
(
"/gaw/
coupon
Exchange/create接口返回异常,返回信息:"
+
response
.
asString
());
}
return
response
;
...
...
@@ -165,4 +165,93 @@ public class gawService {
return
response
;
}
//优惠券兑换接口
public
Response
couponExchange
(
Map
cookie
,
String
appItemId
,
int
skuId
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
mapList
=
new
HashMap
<>();
List
<
Map
>
list
=
new
ArrayList
<>();
mapList
.
put
(
"skuId"
,
skuId
);
mapList
.
put
(
"appItemId"
,
appItemId
);
mapList
.
put
(
"credits"
,
"100"
);
mapList
.
put
(
"price"
,
0
);
list
.
add
(
mapList
);
map
.
put
(
"remark"
,
""
);
//买家留言
map
.
put
(
"degreeId"
,
""
);
map
.
put
(
"actualPrice"
,
"0"
);
//总金额
map
.
put
(
"actualCredits"
,
"100"
);
//总积分
map
.
put
(
"itemParam"
,
list
.
toArray
());
map
.
put
(
"payType"
,
"3"
);
map
.
put
(
"expressPrice"
,
"0"
);
map
.
put
(
"validate"
,
""
);
map
.
put
(
"token"
,
"yrJRr7Cddp2YeQd"
);
JSONObject
jsonParam
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
logger
.
info
(
"请求实物兑换接口:"
+
"/gaw/couponExchange/create"
);
Response
response
=
given
().
contentType
(
"application/json; charset=UTF-8"
).
cookies
(
cookie
).
body
(
jsonParam
).
post
(
"http://"
+
goodsHost
+
"/gaw/couponExchange/create"
);
// Response saveResponse = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).params(map).post("http://"+goodsHost+"/gaw/objectExchange/create");
// response.prettyPrint();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/gaw/couponExchange/create接口返回异常,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/gaw/couponExchange/create接口返回异常,返回信息:"
+
response
.
asString
());
}
return
response
;
}
//虚拟商品(充值)兑换接口
public
Response
virtualExchange
(
Map
cookie
,
String
appItemId
,
int
skuId
)
throws
Exception
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
mapList
=
new
HashMap
<>();
List
<
Map
>
list
=
new
ArrayList
<>();
mapList
.
put
(
"skuId"
,
skuId
);
mapList
.
put
(
"appItemId"
,
appItemId
);
mapList
.
put
(
"credits"
,
"100"
);
mapList
.
put
(
"price"
,
0
);
list
.
add
(
mapList
);
map
.
put
(
"remark"
,
""
);
//买家留言
map
.
put
(
"degreeId"
,
""
);
map
.
put
(
"actualPrice"
,
"0"
);
//总金额
map
.
put
(
"actualCredits"
,
"100"
);
//总积分
map
.
put
(
"itemParam"
,
list
.
toArray
());
map
.
put
(
"payType"
,
"3"
);
map
.
put
(
"expressPrice"
,
"0"
);
map
.
put
(
"validate"
,
""
);
map
.
put
(
"token"
,
"yrJRr7Cddp2YeQd"
);
JSONObject
jsonParam
=
JSONObject
.
parseObject
(
JSON
.
toJSONString
(
map
));
logger
.
info
(
"请求实物兑换接口:"
+
"/gaw/virtualExchange/create"
);
Response
response
=
given
().
contentType
(
"application/json; charset=UTF-8"
).
cookies
(
cookie
).
body
(
jsonParam
).
post
(
"http://"
+
goodsHost
+
"/gaw/virtualExchange/create"
);
// Response saveResponse = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).params(map).post("http://"+goodsHost+"/gaw/objectExchange/create");
// response.prettyPrint();
try
{
Assert
.
assertEquals
(
response
.
jsonPath
().
getString
(
"success"
),
"true"
);
}
catch
(
Exception
e
){
throw
new
Exception
(
"/gaw/virtualExchange/create接口返回异常,返回信息:"
+
response
.
asString
());
}
catch
(
Error
er
){
throw
new
Exception
(
"/gaw/virtualExchange/create接口返回异常,返回信息:"
+
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