parent
d9c49bd2e1
commit
13ccd1b3f0
@ -1,33 +0,0 @@
|
||||
package ${basePackage}.module.system.ent;
|
||||
|
||||
public class ResourceCheck {
|
||||
|
||||
private long resourceId;
|
||||
private String resourceValue;
|
||||
private boolean check;
|
||||
|
||||
|
||||
public long getResourceId() {
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public void setResourceId(long resourceId) {
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
public String getResourceValue() {
|
||||
return resourceValue;
|
||||
}
|
||||
|
||||
public void setResourceValue(String resourceValue) {
|
||||
this.resourceValue = resourceValue;
|
||||
}
|
||||
|
||||
public boolean isCheck() {
|
||||
return check;
|
||||
}
|
||||
|
||||
public void setCheck(boolean check) {
|
||||
this.check = check;
|
||||
}
|
||||
}
|
@ -1,26 +1,27 @@
|
||||
package ${basePackage}.module.system.ent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ResourceTree {
|
||||
public class ResourceTree extends Resource {
|
||||
|
||||
private String resourceModule;
|
||||
private Long pId;
|
||||
|
||||
private List<ResourceCheck> resourceChecks;
|
||||
private List<ResourceTree> children = new ArrayList<>();
|
||||
|
||||
public String getResourceModule() {
|
||||
return resourceModule;
|
||||
public Long getpId() {
|
||||
return pId;
|
||||
}
|
||||
|
||||
public void setResourceModule(String resourceModule) {
|
||||
this.resourceModule = resourceModule;
|
||||
public void setpId(Long pId) {
|
||||
this.pId = pId;
|
||||
}
|
||||
|
||||
public List<ResourceCheck> getResourceChecks() {
|
||||
return resourceChecks;
|
||||
public List<ResourceTree> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setResourceChecks(List<ResourceCheck> resourceChecks) {
|
||||
this.resourceChecks = resourceChecks;
|
||||
public void setChildren(List<ResourceTree> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,142 @@
|
||||
package ${basePackage}.system;
|
||||
|
||||
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 org.springframework.transaction.annotation.Transactional;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.mgr.DeptManager;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
/**
|
||||
* DeptTest - - 部门测试用例
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-27
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
public class DeptTest {
|
||||
|
||||
@Autowired
|
||||
private Token token;
|
||||
|
||||
@Autowired
|
||||
private DeptManager deptManager;
|
||||
|
||||
@Test
|
||||
public void testCreate() {
|
||||
DeptCreateRequest request = new DeptCreateRequest();
|
||||
request.setDeptCode("部门代码");
|
||||
request.setDeptName("部门名称");
|
||||
request.setDeptAlias("部门别名");
|
||||
request.setSupCode("父部门代码");
|
||||
request.setSupName("父部门名称");
|
||||
request.setValid(true);
|
||||
|
||||
DeptCreateResponse response = deptManager.create(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelete() {
|
||||
|
||||
//创建数据
|
||||
DeptCreateRequest createRequest = new DeptCreateRequest();
|
||||
createRequest.setDeptCode("部门代码");
|
||||
createRequest.setDeptName("部门名称");
|
||||
createRequest.setDeptAlias("部门别名");
|
||||
createRequest.setSupCode("父部门代码");
|
||||
createRequest.setSupName("父部门名称");
|
||||
createRequest.setValid(true);
|
||||
|
||||
DeptCreateResponse createResponse = deptManager.create(createRequest,token);
|
||||
|
||||
assertTrue(!createResponse.hasError() && createResponse.getId() > 0);
|
||||
//删除数据
|
||||
DeptDeleteRequest request = new DeptDeleteRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
DeptDeleteResponse response = deptManager.delete(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate() {
|
||||
//创建数据
|
||||
DeptCreateRequest createRequest = new DeptCreateRequest();
|
||||
createRequest.setDeptCode("部门代码");
|
||||
createRequest.setDeptName("部门名称");
|
||||
createRequest.setDeptAlias("部门别名");
|
||||
createRequest.setSupCode("父部门代码");
|
||||
createRequest.setSupName("父部门名称");
|
||||
createRequest.setValid(true);
|
||||
|
||||
DeptCreateResponse createResponse = deptManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//更新数据
|
||||
DeptUpdateRequest request = new DeptUpdateRequest();
|
||||
request.setId(createResponse.getId());
|
||||
request.setDeptCode("部门代码");
|
||||
request.setDeptName("部门名称");
|
||||
request.setDeptAlias("部门别名");
|
||||
request.setSupCode("父部门代码");
|
||||
request.setSupName("父部门名称");
|
||||
request.setValid(true);
|
||||
|
||||
DeptUpdateResponse response = deptManager.update(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFind() {
|
||||
DeptFindRequest request = new DeptFindRequest();
|
||||
request.setDeptCode("部门代码");
|
||||
request.setDeptName("部门名称");
|
||||
request.setDeptAlias("部门别名");
|
||||
request.setSupCode("父部门代码");
|
||||
request.setSupName("父部门名称");
|
||||
request.setValid(true);
|
||||
|
||||
DeptFindResponse response = deptManager.find(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGet() {
|
||||
//创建数据
|
||||
DeptCreateRequest createRequest = new DeptCreateRequest();
|
||||
createRequest.setDeptCode("部门代码");
|
||||
createRequest.setDeptName("部门名称");
|
||||
createRequest.setDeptAlias("部门别名");
|
||||
createRequest.setSupCode("父部门代码");
|
||||
createRequest.setSupName("父部门名称");
|
||||
createRequest.setValid(true);
|
||||
|
||||
DeptCreateResponse createResponse = deptManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//获得数据
|
||||
DeptGetRequest request = new DeptGetRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
DeptGetResponse response = deptManager.get(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getDept() != null);
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package ${basePackage}.system;
|
||||
|
||||
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 org.springframework.transaction.annotation.Transactional;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.mgr.RoleResourceManager;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
/**
|
||||
* RoleResourceTest - - 角色资源关系测试用例
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-27
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
public class RoleResourceTest {
|
||||
|
||||
@Autowired
|
||||
private Token token;
|
||||
|
||||
@Autowired
|
||||
private RoleResourceManager roleResourceManager;
|
||||
|
||||
@Test
|
||||
public void testCreate() {
|
||||
RoleResourceCreateRequest request = new RoleResourceCreateRequest();
|
||||
request.setRoleId(1L);
|
||||
request.setResourceId(1L);
|
||||
|
||||
RoleResourceCreateResponse response = roleResourceManager.create(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelete() {
|
||||
|
||||
//创建数据
|
||||
RoleResourceCreateRequest createRequest = new RoleResourceCreateRequest();
|
||||
createRequest.setRoleId(1L);
|
||||
createRequest.setResourceId(1L);
|
||||
|
||||
RoleResourceCreateResponse createResponse = roleResourceManager.create(createRequest,token);
|
||||
|
||||
assertTrue(!createResponse.hasError() && createResponse.getId() > 0);
|
||||
//删除数据
|
||||
RoleResourceDeleteRequest request = new RoleResourceDeleteRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
RoleResourceDeleteResponse response = roleResourceManager.delete(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate() {
|
||||
//创建数据
|
||||
RoleResourceCreateRequest createRequest = new RoleResourceCreateRequest();
|
||||
createRequest.setRoleId(1L);
|
||||
createRequest.setResourceId(1L);
|
||||
|
||||
RoleResourceCreateResponse createResponse = roleResourceManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//更新数据
|
||||
RoleResourceUpdateRequest request = new RoleResourceUpdateRequest();
|
||||
request.setId(createResponse.getId());
|
||||
request.setRoleId(1L);
|
||||
request.setResourceId(1L);
|
||||
|
||||
RoleResourceUpdateResponse response = roleResourceManager.update(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFind() {
|
||||
RoleResourceFindRequest request = new RoleResourceFindRequest();
|
||||
request.setRoleId(1L);
|
||||
request.setResourceId(1L);
|
||||
|
||||
RoleResourceFindResponse response = roleResourceManager.find(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGet() {
|
||||
//创建数据
|
||||
RoleResourceCreateRequest createRequest = new RoleResourceCreateRequest();
|
||||
createRequest.setRoleId(1L);
|
||||
createRequest.setResourceId(1L);
|
||||
|
||||
RoleResourceCreateResponse createResponse = roleResourceManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//获得数据
|
||||
RoleResourceGetRequest request = new RoleResourceGetRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
RoleResourceGetResponse response = roleResourceManager.get(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getRoleResource() != null);
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
package ${basePackage}.system;
|
||||
|
||||
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 org.springframework.transaction.annotation.Transactional;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.mgr.RoleManager;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
/**
|
||||
* RoleTest - - 角色测试用例
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-27
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
public class RoleTest {
|
||||
|
||||
@Autowired
|
||||
private Token token;
|
||||
|
||||
@Autowired
|
||||
private RoleManager roleManager;
|
||||
|
||||
@Test
|
||||
public void testCreate() {
|
||||
RoleCreateRequest request = new RoleCreateRequest();
|
||||
request.setCode("角色代码");
|
||||
request.setName("角色名称");
|
||||
request.setComment("角色描述");
|
||||
|
||||
RoleCreateResponse response = roleManager.create(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelete() {
|
||||
|
||||
//创建数据
|
||||
RoleCreateRequest createRequest = new RoleCreateRequest();
|
||||
createRequest.setCode("角色代码");
|
||||
createRequest.setName("角色名称");
|
||||
createRequest.setComment("角色描述");
|
||||
|
||||
RoleCreateResponse createResponse = roleManager.create(createRequest,token);
|
||||
|
||||
assertTrue(!createResponse.hasError() && createResponse.getId() > 0);
|
||||
//删除数据
|
||||
RoleDeleteRequest request = new RoleDeleteRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
RoleDeleteResponse response = roleManager.delete(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate() {
|
||||
//创建数据
|
||||
RoleCreateRequest createRequest = new RoleCreateRequest();
|
||||
createRequest.setCode("角色代码");
|
||||
createRequest.setName("角色名称");
|
||||
createRequest.setComment("角色描述");
|
||||
|
||||
RoleCreateResponse createResponse = roleManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//更新数据
|
||||
RoleUpdateRequest request = new RoleUpdateRequest();
|
||||
request.setId(createResponse.getId());
|
||||
request.setCode("角色代码");
|
||||
request.setName("角色名称");
|
||||
request.setComment("角色描述");
|
||||
|
||||
RoleUpdateResponse response = roleManager.update(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFind() {
|
||||
RoleFindRequest request = new RoleFindRequest();
|
||||
request.setCode("角色代码");
|
||||
request.setName("角色名称");
|
||||
request.setComment("角色描述");
|
||||
|
||||
RoleFindResponse response = roleManager.find(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGet() {
|
||||
//创建数据
|
||||
RoleCreateRequest createRequest = new RoleCreateRequest();
|
||||
createRequest.setCode("角色代码");
|
||||
createRequest.setName("角色名称");
|
||||
createRequest.setComment("角色描述");
|
||||
|
||||
RoleCreateResponse createResponse = roleManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//获得数据
|
||||
RoleGetRequest request = new RoleGetRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
RoleGetResponse response = roleManager.get(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getRole() != null);
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package ${basePackage}.system;
|
||||
|
||||
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 org.springframework.transaction.annotation.Transactional;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.mgr.UserRoleManager;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
/**
|
||||
* UserRoleTest - - 用户角色授权测试用例
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-27
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
public class UserRoleTest {
|
||||
|
||||
@Autowired
|
||||
private Token token;
|
||||
|
||||
@Autowired
|
||||
private UserRoleManager userRoleManager;
|
||||
|
||||
@Test
|
||||
public void testCreate() {
|
||||
UserRoleCreateRequest request = new UserRoleCreateRequest();
|
||||
request.setUserId(1L);
|
||||
request.setRoleId(1L);
|
||||
|
||||
UserRoleCreateResponse response = userRoleManager.create(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelete() {
|
||||
|
||||
//创建数据
|
||||
UserRoleCreateRequest createRequest = new UserRoleCreateRequest();
|
||||
createRequest.setUserId(1L);
|
||||
createRequest.setRoleId(1L);
|
||||
|
||||
UserRoleCreateResponse createResponse = userRoleManager.create(createRequest,token);
|
||||
|
||||
assertTrue(!createResponse.hasError() && createResponse.getId() > 0);
|
||||
//删除数据
|
||||
UserRoleDeleteRequest request = new UserRoleDeleteRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
UserRoleDeleteResponse response = userRoleManager.delete(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate() {
|
||||
//创建数据
|
||||
UserRoleCreateRequest createRequest = new UserRoleCreateRequest();
|
||||
createRequest.setUserId(1L);
|
||||
createRequest.setRoleId(1L);
|
||||
|
||||
UserRoleCreateResponse createResponse = userRoleManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//更新数据
|
||||
UserRoleUpdateRequest request = new UserRoleUpdateRequest();
|
||||
request.setId(createResponse.getId());
|
||||
request.setUserId(1L);
|
||||
request.setRoleId(1L);
|
||||
|
||||
UserRoleUpdateResponse response = userRoleManager.update(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFind() {
|
||||
UserRoleFindRequest request = new UserRoleFindRequest();
|
||||
request.setUserId(1L);
|
||||
request.setRoleId(1L);
|
||||
|
||||
UserRoleFindResponse response = userRoleManager.find(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGet() {
|
||||
//创建数据
|
||||
UserRoleCreateRequest createRequest = new UserRoleCreateRequest();
|
||||
createRequest.setUserId(1L);
|
||||
createRequest.setRoleId(1L);
|
||||
|
||||
UserRoleCreateResponse createResponse = userRoleManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//获得数据
|
||||
UserRoleGetRequest request = new UserRoleGetRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
UserRoleGetResponse response = userRoleManager.get(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getUserRole() != null);
|
||||
}
|
||||
}
|
@ -0,0 +1,153 @@
|
||||
package ${basePackage}.system;
|
||||
|
||||
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 org.springframework.transaction.annotation.Transactional;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.mgr.UserManager;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
/**
|
||||
* UserTest - - 用户测试用例
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-27
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
public class UserTest {
|
||||
|
||||
@Autowired
|
||||
private Token token;
|
||||
|
||||
@Autowired
|
||||
private UserManager userManager;
|
||||
|
||||
@Test
|
||||
public void testCreate() {
|
||||
UserCreateRequest request = new UserCreateRequest();
|
||||
request.setUserName("用户账户");
|
||||
request.setUserCode("用户代码");
|
||||
request.setUserAlias("用户别名");
|
||||
request.setUserPwd("用户密码");
|
||||
request.setUserStatus("code");
|
||||
request.setDeptId(1L);
|
||||
request.setDeptCode("部门代码");
|
||||
request.setDeptName("部门名称");
|
||||
|
||||
UserCreateResponse response = userManager.create(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelete() {
|
||||
|
||||
//创建数据
|
||||
UserCreateRequest createRequest = new UserCreateRequest();
|
||||
createRequest.setUserName("用户账户");
|
||||
createRequest.setUserCode("用户代码");
|
||||
createRequest.setUserAlias("用户别名");
|
||||
createRequest.setUserPwd("用户密码");
|
||||
createRequest.setUserStatus("code");
|
||||
createRequest.setDeptId(1L);
|
||||
createRequest.setDeptCode("部门代码");
|
||||
createRequest.setDeptName("部门名称");
|
||||
|
||||
UserCreateResponse createResponse = userManager.create(createRequest,token);
|
||||
|
||||
assertTrue(!createResponse.hasError() && createResponse.getId() > 0);
|
||||
//删除数据
|
||||
UserDeleteRequest request = new UserDeleteRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
UserDeleteResponse response = userManager.delete(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate() {
|
||||
//创建数据
|
||||
UserCreateRequest createRequest = new UserCreateRequest();
|
||||
createRequest.setUserName("用户账户");
|
||||
createRequest.setUserCode("用户代码");
|
||||
createRequest.setUserAlias("用户别名");
|
||||
createRequest.setUserPwd("用户密码");
|
||||
createRequest.setUserStatus("code");
|
||||
createRequest.setDeptId(1L);
|
||||
createRequest.setDeptCode("部门代码");
|
||||
createRequest.setDeptName("部门名称");
|
||||
|
||||
UserCreateResponse createResponse = userManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//更新数据
|
||||
UserUpdateRequest request = new UserUpdateRequest();
|
||||
request.setId(createResponse.getId());
|
||||
request.setUserName("用户账户");
|
||||
request.setUserCode("用户代码");
|
||||
request.setUserAlias("用户别名");
|
||||
request.setUserPwd("用户密码");
|
||||
request.setUserStatus("code");
|
||||
request.setDeptId(1L);
|
||||
request.setDeptCode("部门代码");
|
||||
request.setDeptName("部门名称");
|
||||
|
||||
UserUpdateResponse response = userManager.update(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFind() {
|
||||
UserFindRequest request = new UserFindRequest();
|
||||
request.setUserName("用户账户");
|
||||
request.setUserCode("用户代码");
|
||||
request.setUserAlias("用户别名");
|
||||
request.setUserStatus("code");
|
||||
request.setDeptId(1L);
|
||||
request.setDeptCode("部门代码");
|
||||
request.setDeptName("部门名称");
|
||||
|
||||
UserFindResponse response = userManager.find(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGet() {
|
||||
//创建数据
|
||||
UserCreateRequest createRequest = new UserCreateRequest();
|
||||
createRequest.setUserName("用户账户");
|
||||
createRequest.setUserCode("用户代码");
|
||||
createRequest.setUserAlias("用户别名");
|
||||
createRequest.setUserPwd("用户密码");
|
||||
createRequest.setUserStatus("code");
|
||||
createRequest.setDeptId(1L);
|
||||
createRequest.setDeptCode("部门代码");
|
||||
createRequest.setDeptName("部门名称");
|
||||
|
||||
UserCreateResponse createResponse = userManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//获得数据
|
||||
UserGetRequest request = new UserGetRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
UserGetResponse response = userManager.get(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getUser() != null);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue