|
|
@ -1,15 +1,16 @@
|
|
|
|
package ${basePackage}.system;
|
|
|
|
package xyz.wbsite.system;
|
|
|
|
|
|
|
|
|
|
|
|
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.annotation.Rollback;
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import ${basePackage}.frame.base.Token;
|
|
|
|
import xyz.wbsite.frame.base.Token;
|
|
|
|
import ${basePackage}.module.system.mgr.DeptManager;
|
|
|
|
import xyz.wbsite.module.system.mgr.DeptManager;
|
|
|
|
import ${basePackage}.module.system.req.*;
|
|
|
|
import xyz.wbsite.module.system.req.*;
|
|
|
|
import ${basePackage}.module.system.rsp.*;
|
|
|
|
import xyz.wbsite.module.system.rsp.*;
|
|
|
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
|
|
|
|
|
|
|
@ -33,18 +34,26 @@ public class DeptTest {
|
|
|
|
private DeptManager deptManager;
|
|
|
|
private DeptManager deptManager;
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
|
|
|
|
@Rollback(false)
|
|
|
|
public void testCreate() {
|
|
|
|
public void testCreate() {
|
|
|
|
DeptCreateRequest request = new DeptCreateRequest();
|
|
|
|
{
|
|
|
|
request.setDeptCode("部门代码");
|
|
|
|
DeptCreateRequest request = new DeptCreateRequest();
|
|
|
|
request.setDeptName("部门名称");
|
|
|
|
request.setDeptCode("A00");
|
|
|
|
request.setDeptAlias("部门别名");
|
|
|
|
request.setDeptName("开发部");
|
|
|
|
request.setSupCode("上级代码");
|
|
|
|
request.setDeptAlias("开发部");
|
|
|
|
request.setSupName("上级名称");
|
|
|
|
request.setValid(true);
|
|
|
|
request.setValid(true);
|
|
|
|
DeptCreateResponse response = deptManager.create(request,token);
|
|
|
|
|
|
|
|
assertTrue(!response.hasError());
|
|
|
|
DeptCreateResponse response = deptManager.create(request,token);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
assertTrue(!response.hasError());
|
|
|
|
DeptCreateRequest request = new DeptCreateRequest();
|
|
|
|
|
|
|
|
request.setDeptCode("A00_B00");
|
|
|
|
|
|
|
|
request.setDeptName("开发部开发一组");
|
|
|
|
|
|
|
|
request.setDeptAlias("开发一组");
|
|
|
|
|
|
|
|
request.setValid(true);
|
|
|
|
|
|
|
|
DeptCreateResponse response = deptManager.create(request,token);
|
|
|
|
|
|
|
|
assertTrue(!response.hasError());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -52,11 +61,9 @@ public class DeptTest {
|
|
|
|
|
|
|
|
|
|
|
|
//创建数据
|
|
|
|
//创建数据
|
|
|
|
DeptCreateRequest createRequest = new DeptCreateRequest();
|
|
|
|
DeptCreateRequest createRequest = new DeptCreateRequest();
|
|
|
|
createRequest.setDeptCode("部门代码");
|
|
|
|
createRequest.setDeptCode("A00");
|
|
|
|
createRequest.setDeptName("部门名称");
|
|
|
|
createRequest.setDeptName("开发部");
|
|
|
|
createRequest.setDeptAlias("部门别名");
|
|
|
|
createRequest.setDeptAlias("开发部");
|
|
|
|
createRequest.setSupCode("上级代码");
|
|
|
|
|
|
|
|
createRequest.setSupName("上级名称");
|
|
|
|
|
|
|
|
createRequest.setValid(true);
|
|
|
|
createRequest.setValid(true);
|
|
|
|
|
|
|
|
|
|
|
|
DeptCreateResponse createResponse = deptManager.create(createRequest,token);
|
|
|
|
DeptCreateResponse createResponse = deptManager.create(createRequest,token);
|
|
|
@ -75,11 +82,9 @@ public class DeptTest {
|
|
|
|
public void testUpdate() {
|
|
|
|
public void testUpdate() {
|
|
|
|
//创建数据
|
|
|
|
//创建数据
|
|
|
|
DeptCreateRequest createRequest = new DeptCreateRequest();
|
|
|
|
DeptCreateRequest createRequest = new DeptCreateRequest();
|
|
|
|
createRequest.setDeptCode("部门代码");
|
|
|
|
createRequest.setDeptCode("A00");
|
|
|
|
createRequest.setDeptName("部门名称");
|
|
|
|
createRequest.setDeptName("开发部");
|
|
|
|
createRequest.setDeptAlias("部门别名");
|
|
|
|
createRequest.setDeptAlias("开发部");
|
|
|
|
createRequest.setSupCode("上级代码");
|
|
|
|
|
|
|
|
createRequest.setSupName("上级名称");
|
|
|
|
|
|
|
|
createRequest.setValid(true);
|
|
|
|
createRequest.setValid(true);
|
|
|
|
|
|
|
|
|
|
|
|
DeptCreateResponse createResponse = deptManager.create(createRequest, token);
|
|
|
|
DeptCreateResponse createResponse = deptManager.create(createRequest, token);
|
|
|
@ -89,11 +94,9 @@ public class DeptTest {
|
|
|
|
//更新数据
|
|
|
|
//更新数据
|
|
|
|
DeptUpdateRequest request = new DeptUpdateRequest();
|
|
|
|
DeptUpdateRequest request = new DeptUpdateRequest();
|
|
|
|
request.setId(createResponse.getId());
|
|
|
|
request.setId(createResponse.getId());
|
|
|
|
request.setDeptCode("部门代码");
|
|
|
|
request.setDeptCode("A00");
|
|
|
|
request.setDeptName("部门名称");
|
|
|
|
request.setDeptName("开发部");
|
|
|
|
request.setDeptAlias("部门别名");
|
|
|
|
request.setDeptAlias("开发部");
|
|
|
|
request.setSupCode("上级代码");
|
|
|
|
|
|
|
|
request.setSupName("上级名称");
|
|
|
|
|
|
|
|
request.setValid(true);
|
|
|
|
request.setValid(true);
|
|
|
|
|
|
|
|
|
|
|
|
DeptUpdateResponse response = deptManager.update(request,token);
|
|
|
|
DeptUpdateResponse response = deptManager.update(request,token);
|
|
|
@ -104,11 +107,9 @@ public class DeptTest {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void testFind() {
|
|
|
|
public void testFind() {
|
|
|
|
DeptFindRequest request = new DeptFindRequest();
|
|
|
|
DeptFindRequest request = new DeptFindRequest();
|
|
|
|
request.setDeptCode("部门代码");
|
|
|
|
request.setDeptCode("A00");
|
|
|
|
request.setDeptName("部门名称");
|
|
|
|
request.setDeptName("开发部");
|
|
|
|
request.setDeptAlias("部门别名");
|
|
|
|
request.setDeptAlias("开发部");
|
|
|
|
request.setSupCode("上级代码");
|
|
|
|
|
|
|
|
request.setSupName("上级名称");
|
|
|
|
|
|
|
|
request.setValid(true);
|
|
|
|
request.setValid(true);
|
|
|
|
|
|
|
|
|
|
|
|
DeptFindResponse response = deptManager.find(request,token);
|
|
|
|
DeptFindResponse response = deptManager.find(request,token);
|
|
|
@ -120,11 +121,9 @@ public class DeptTest {
|
|
|
|
public void testGet() {
|
|
|
|
public void testGet() {
|
|
|
|
//创建数据
|
|
|
|
//创建数据
|
|
|
|
DeptCreateRequest createRequest = new DeptCreateRequest();
|
|
|
|
DeptCreateRequest createRequest = new DeptCreateRequest();
|
|
|
|
createRequest.setDeptCode("部门代码");
|
|
|
|
createRequest.setDeptCode("A00");
|
|
|
|
createRequest.setDeptName("部门名称");
|
|
|
|
createRequest.setDeptName("开发部");
|
|
|
|
createRequest.setDeptAlias("部门别名");
|
|
|
|
createRequest.setDeptAlias("开发部");
|
|
|
|
createRequest.setSupCode("上级代码");
|
|
|
|
|
|
|
|
createRequest.setSupName("上级名称");
|
|
|
|
|
|
|
|
createRequest.setValid(true);
|
|
|
|
createRequest.setValid(true);
|
|
|
|
|
|
|
|
|
|
|
|
DeptCreateResponse createResponse = deptManager.create(createRequest, token);
|
|
|
|
DeptCreateResponse createResponse = deptManager.create(createRequest, token);
|
|
|
|