@Test
public void correctDeptDepend() {

  // Correct department dependencies
  SysDept deptA = new SysDept("A", "deptA");
  SysDept deptAA = new SysDept("AA", "deptAA");
  deptAA.setParentCode("A");
  SysDept deptAB = new SysDept("AB", "deptAB");
  deptAB.setParentCode("A");
  SysDept deptAAA = new SysDept("AAA", "deptAAA");
  deptAAA.setParentCode("AA");
  SysDept deptABA = new SysDept("ABA", "deptABA");
  deptABA.setParentCode("AB");
  List<SysDept> depts = new ArrayList<>();
  depts.addAll(Arrays.asList(deptA, deptAA, deptAB, deptAAA, deptABA));
  for (SysDept dept : depts) {
    Response response = sysDeptRestApi.add(dept);
    CommonDataTest.assertDeptResponseSuccess(response);
  }
  JsonResponse<ListResult<SysDeptTree>> response = CommonDataTest.queryDeptTreeList();
  assertEquals(response.getAttributes().size(), 0);
  assertEquals(response.getResult().getTotal(), 5);
}