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 24f4550a
authored
Mar 17, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
单元测试
1 parent
3b418666
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
24 deletions
src/test/java/cn/com/glsx/admin/modules/service/HomeServiceTest.java
src/test/java/cn/com/glsx/admin/modules/service/HomeServiceTest.java
View file @
24f4550
...
...
@@ -4,12 +4,11 @@ import cn.com.glsx.Application;
import
cn.com.glsx.admin.common.constants.Constants
;
import
cn.com.glsx.admin.modules.model.ActiveDeviceVo
;
import
cn.com.glsx.admin.modules.model.DeviceBindVo
;
import
cn.com.glsx.auth.model.Department
;
import
cn.com.glsx.auth.model.Role
;
import
cn.com.glsx.auth.api.AuthFeignClient
;
import
cn.com.glsx.auth.model.SyntheticUser
;
import
cn.com.glsx.auth.model.Tenant
;
import
cn.com.glsx.auth.utils.ShieldContextHolder
;
import
com.alibaba.fastjson.JSON
;
import
com.glsx.plat.core.web.R
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -19,7 +18,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -29,30 +27,15 @@ import java.util.Map;
public
class
HomeServiceTest
{
@Autowired
private
AuthFeignClient
authFeignClient
;
@Autowired
private
HomeService
homeService
;
@Before
public
void
runBeforeTestMethod
()
{
SyntheticUser
user
=
new
SyntheticUser
();
user
.
setUserId
(
8160L
);
user
.
setIsSupperAdmin
(
false
);
user
.
setAccount
(
"zlgj"
);
// 山东顺骋租户数据
Tenant
tenant
=
new
Tenant
();
tenant
.
setTenantId
(
86L
);
tenant
.
setTenantName
(
"仲利国际"
);
user
.
setTenant
(
tenant
);
Department
department
=
new
Department
();
department
.
setDeptId
(
4602L
);
user
.
setDepartment
(
department
);
List
<
Role
>
roleList
=
new
ArrayList
<>();
Role
role
=
new
Role
();
role
.
setRoleId
(
74L
);
roleList
.
add
(
role
);
user
.
setRoles
(
roleList
);
ShieldContextHolder
.
setUser
(
user
);
R
<
SyntheticUser
>
userR
=
authFeignClient
.
getAuthUserById
(
8160L
);
ShieldContextHolder
.
setUser
(
userR
.
getData
(
SyntheticUser
.
class
));
}
@Test
...
...
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