@Test
public void resetParentDeptTest() {

  SysDept deptA = new SysDept("A", "deptA");
  SysDept deptAA = new SysDept("AA", "deptAA");
  deptAA.setParentCode("A");
  SysDept deptAB = new SysDept("AB", "deptAB");
  deptAB.setParentCode("A");
  List<SysDept> depts = new ArrayList<>();
  depts.addAll(Arrays.asList(deptA, deptAA, deptAB));
  for (SysDept dept : depts) {
    Response response = sysDeptRestApi.add(dept);
    CommonDataTest.assertDeptResponseSuccess(response);
  }
  Response response = sysDeptRestApi.resetParentDept();
  CommonDataTest.assertDeptResponseSuccess(response);
  JsonResponse<ListResult<SysDeptTree>> response2 = CommonDataTest.queryDeptTreeList();
  assertTrue(response2.getSuccess());
  for (SysDeptTree deptTree : response2.getResult().getRecords()) {
    assertEquals(deptTree.getParentCode(), null);
  }
}