Commit 18a2f77f by 王欣伟

大数据研判测试

1 parent 3914a003
...@@ -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);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!