Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-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
youjj
cloud-platform
Commits
7ab1dc79
Commit
7ab1dc79
authored
Aug 09, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购房车
parent
015d00f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
245 deletions
+0
-245
MapperTest.java
.../src/test/java/com/github/wxiaoqi/service/MapperTest.java
+0
-34
ServiceTest.java
...src/test/java/com/github/wxiaoqi/service/ServiceTest.java
+0
-211
No files found.
ace-modules/ace-admin/src/test/java/com/github/wxiaoqi/service/MapperTest.java
deleted
100644 → 0
View file @
015d00f7
package
com
.
github
.
wxiaoqi
.
service
;
import
com.github.wxiaoqi.security.admin.AdminBootstrap
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/6 16:43
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
{
AdminBootstrap
.
class
})
@Slf4j
public
class
MapperTest
{
@Autowired
private
AppUserMapper
appUserMapper
;
@Test
public
void
testOptional
(){
}
}
ace-modules/ace-admin/src/test/java/com/github/wxiaoqi/service/ServiceTest.java
deleted
100644 → 0
View file @
015d00f7
package
com
.
github
.
wxiaoqi
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.AdminBootstrap
;
import
com.github.wxiaoqi.security.admin.biz.*
;
import
com.github.wxiaoqi.security.admin.dto.UserPostionDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletFindDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MvcResult
;
import
org.springframework.test.web.servlet.request.MockMvcRequestBuilders
;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.web.context.WebApplicationContext
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 15:37
*/
@Slf4j
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
(
classes
=
AdminBootstrap
.
class
)
public
class
ServiceTest
{
@Autowired
private
WebApplicationContext
wac
;
@Autowired
private
MyWalletBiz
myWalletBiz
;
@Autowired
private
MyWalletDetailBiz
myWalletDetailBiz
;
@Autowired
private
AppUserLoginBiz
appUserLoginBiz
;
@Autowired
private
AppUserDetailBiz
appUserDetailBiz
;
private
MockMvc
mockMvc
;
private
String
token
;
@Autowired
private
GroupBiz
groupBiz
;
// @Before
public
void
init
()
throws
Exception
{
mockMvc
=
MockMvcBuilders
.
webAppContextSetup
(
wac
).
build
();
long
loginCode
=
0
;
/* LinkedMultiValueMap smsparam = new LinkedMultiValueMap();
smsparam.put("username",Arrays.asList("19972242603"));
smsparam.put("type",Arrays.asList(1));
MvcResult smsResult = mockMvc.perform(MockMvcRequestBuilders.post("/api/app/user/sendsms").params(smsparam)
.header("Content-Type", "application/json"))
.andExpect(status().isOk())
.andReturn();
loginCode = Long.valueOf(smsResult.getResponse().getContentAsString());
log.debug("登录验证码:【{}】",loginCode);*/
LinkedMultiValueMap
loginParams
=
new
LinkedMultiValueMap
();
loginParams
.
put
(
"username"
,
Arrays
.
asList
(
"19972242603"
));
loginParams
.
put
(
"mobilecode"
,
Arrays
.
asList
(
"5003"
));
loginParams
.
put
(
"password"
,
Arrays
.
asList
(
"12345678"
));
loginParams
.
put
(
"type"
,
Arrays
.
asList
(
"1"
));
MvcResult
tokenResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
post
(
"/api/app/user/login"
)
.
params
(
loginParams
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
isOk
())
.
andReturn
();
String
contentAsString
=
tokenResult
.
getResponse
().
getContentAsString
();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
contentAsString
);
log
.
debug
(
"**************************"
);
log
.
debug
(
"登录的token:【{}】"
,
token
);
log
.
debug
(
"**************************"
);
}
@Test
public
void
testWalletPage
()
throws
Exception
{
WalletFindDTO
walletFindDTO
=
new
WalletFindDTO
();
walletFindDTO
.
setPhone
(
"19972242603"
);
walletFindDTO
.
setPage
(
1
);
walletFindDTO
.
setLimit
(
20
);
LinkedMultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<>();
params
.
put
(
"page"
,
Arrays
.
asList
(
"1"
));
params
.
put
(
"limit"
,
Arrays
.
asList
(
"20"
));
params
.
put
(
"phone"
,
Arrays
.
asList
(
"19972242603"
));
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/wallet/admin/page"
).
params
(
params
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
log
.
debug
(
"返回的结果:【{}】"
,
mvcResult
.
getResponse
().
getContentAsString
());
}
@Test
public
void
testBatchUpdatePostion
()
throws
Exception
{
List
<
UserPostionDTO
>
userPostionDTOS
=
new
ArrayList
<>();
UserPostionDTO
userPostionDTO
=
new
UserPostionDTO
();
userPostionDTO
.
setId
(
1
);
userPostionDTO
.
setExtract
(
50
);
UserPostionDTO
userPostion2
=
new
UserPostionDTO
();
userPostion2
.
setExtract
(
25
);
userPostion2
.
setId
(
2
);
userPostionDTOS
.
add
(
userPostionDTO
);
userPostionDTOS
.
add
(
userPostion2
);
log
.
debug
(
"更新数据:【{}】"
,
JSON
.
toJSONString
(
userPostionDTOS
));
mockMvc
.
perform
(
MockMvcRequestBuilders
.
put
(
"/postion/admin"
)
.
header
(
"Content-Type"
,
"application/json"
)
.
content
(
JSON
.
toJSONString
(
userPostionDTOS
)))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
}
@Test
public
void
testPostions
()
throws
Exception
{
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/postion/admin/postions"
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
log
.
debug
(
"返回结果:【{}】"
,
mvcResult
.
getResponse
().
getContentAsString
());
}
@Test
public
void
testWalletDetailAdminPage
()
throws
Exception
{
LinkedMultiValueMap
<
String
,
String
>
linkedMultiValueMap
=
new
LinkedMultiValueMap
();
linkedMultiValueMap
.
put
(
"page"
,
Arrays
.
asList
(
"1"
));
linkedMultiValueMap
.
put
(
"limit"
,
Arrays
.
asList
(
"20"
));
linkedMultiValueMap
.
put
(
"source"
,
Arrays
.
asList
(
"1"
));
linkedMultiValueMap
.
put
(
"username"
,
Arrays
.
asList
(
"XX"
));
// linkedMultiValueMap.put("phone", Arrays.asList("19972242603"));
log
.
debug
(
"请求参数:【{}】"
,
JSON
.
toJSONString
(
linkedMultiValueMap
));
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/walletdetail/admin/page"
).
params
(
linkedMultiValueMap
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
String
contentAsString
=
mvcResult
.
getResponse
().
getContentAsString
();
log
.
debug
(
"请求返回的结果:【{}】"
,
contentAsString
);
}
/**
* walletcath/admin
*/
@Test
public
void
testWalletCathPage
()
throws
Exception
{
LinkedMultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<>();
params
.
put
(
"page"
,
Arrays
.
asList
(
"1"
));
params
.
put
(
"limit"
,
Arrays
.
asList
(
"20"
));
params
.
put
(
"username"
,
Arrays
.
asList
(
"XX_981132"
));
params
.
put
(
"phone"
,
Arrays
.
asList
(
"19972242603"
));
params
.
put
(
"state"
,
Arrays
.
asList
(
"1"
));
log
.
debug
(
"请求参数:【{}】"
,
JSON
.
toJSONString
(
params
));
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/walletcath/admin/page"
).
params
(
params
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
is
(
200
))
.
andReturn
();
log
.
debug
(
"返回的结果:【{}】"
,
mvcResult
.
getResponse
().
getContentAsString
());
}
@Test
public
void
testPromote
()
throws
Exception
{
MvcResult
mvcResult
=
mockMvc
.
perform
(
MockMvcRequestBuilders
.
get
(
""
)
.
header
(
"Authorization"
,
token
)
.
header
(
"Content-Type"
,
"application/json"
))
.
andExpect
(
status
().
isOk
())
.
andReturn
();
log
.
debug
(
"返回的结果:【{}】"
,
mvcResult
.
getResponse
().
getContentAsString
());
}
@Test
public
void
testUnBinding
(){
appUserLoginBiz
.
unBindThirdPartyByType
(
"wx"
,
"18178966185"
,
265
);
}
@Test
public
void
testGetByUserName
(){
appUserLoginBiz
.
getUserByUsername
(
"18178966185"
);
}
}
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