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 18a2f77f
authored
Mar 21, 2022
by
王欣伟
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
大数据研判测试
1 parent
3914a003
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
src/test/java/cn/com/glsx/admin/modules/service/JudgmentServiceTest.java
src/test/java/cn/com/glsx/admin/modules/service/JudgmentServiceTest.java
View file @
18a2f77
...
@@ -2,15 +2,24 @@ package cn.com.glsx.admin.modules.service;
...
@@ -2,15 +2,24 @@ package cn.com.glsx.admin.modules.service;
import
cn.com.glsx.Application
;
import
cn.com.glsx.Application
;
import
cn.com.glsx.admin.modules.model.param.JudgmentSearch
;
import
cn.com.glsx.admin.modules.model.param.JudgmentSearch
;
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.model.Tenant
;
import
cn.com.glsx.auth.utils.ShieldContextHolder
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.util.ArrayList
;
import
java.util.List
;
@Slf4j
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
@SpringBootTest
(
classes
=
Application
.
class
,
webEnvironment
=
SpringBootTest
.
WebEnvironment
.
RANDOM_PORT
)
...
@@ -19,9 +28,34 @@ public class JudgmentServiceTest {
...
@@ -19,9 +28,34 @@ public class JudgmentServiceTest {
@Autowired
@Autowired
private
JudgmentService
judgmentService
;
private
JudgmentService
judgmentService
;
@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
);
}
@Test
@Test
public
void
findJudgmentList
()
{
public
void
findJudgmentList
()
{
JudgmentSearch
judgmentSearch
=
new
JudgmentSearch
();
JudgmentSearch
judgmentSearch
=
new
JudgmentSearch
();
judgmentSearch
.
setAlarmStatus
(
2
);
judgmentSearch
.
setPageNumber
(
1
);
judgmentSearch
.
setPageNumber
(
1
);
judgmentSearch
.
setPageSize
(
10
);
judgmentSearch
.
setPageSize
(
10
);
PageInfo
judgmentList
=
judgmentService
.
findJudgmentList
(
judgmentSearch
);
PageInfo
judgmentList
=
judgmentService
.
findJudgmentList
(
judgmentSearch
);
...
...
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