Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c3145efd
authored
May 27, 2021
by
黄小葱
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
测试用例
1 parent
b540ea22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
src/test/java/cn/com/glsx/admin/modules/service/VehicleServiceTest.java
src/test/java/cn/com/glsx/admin/modules/service/VehicleServiceTest.java
0 → 100644
View file @
c3145ef
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.admin.modules.model.TrialDriveVehiclePageDTO
;
import
cn.com.glsx.admin.modules.model.param.VehicleManageSearch
;
import
cn.com.glsx.auth.model.Department
;
import
cn.com.glsx.auth.model.Role
;
import
cn.com.glsx.auth.model.SyntheticUser
;
import
cn.com.glsx.auth.utils.ShieldContextHolder
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Before
;
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.SpringRunner
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @Desc:
* @Author huangxc
* @Date 2021/5/27
*/
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
public
class
VehicleServiceTest
{
@Autowired
private
VehicleService
vehicleService
;
@Before
public
void
runBeforeTestMethod
()
{
SyntheticUser
user
=
new
SyntheticUser
();
user
.
setUserId
(
6551L
);
user
.
setIsAdmin
(
false
);
user
.
setAccount
(
"DGD101"
);
Department
department
=
new
Department
();
department
.
setDeptId
(
182L
);
user
.
setDepartment
(
department
);
List
<
Role
>
roleList
=
new
ArrayList
<>();
Role
role
=
new
Role
();
role
.
setRoleId
(
38L
);
roleList
.
add
(
role
);
user
.
setRoles
(
roleList
);
ShieldContextHolder
.
setUser
(
user
);
}
@Test
public
void
searchTrialDriveTest
()
{
VehicleManageSearch
search
=
new
VehicleManageSearch
();
search
.
setSearchKey
(
"雅阁汽油版"
);
PageInfo
<
TrialDriveVehiclePageDTO
>
trialDriveVehicle
=
vehicleService
.
searchTrialDrive
(
search
);
System
.
out
.
println
(
"======="
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
trialDriveVehicle
));
System
.
out
.
println
(
"======="
);
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment