@Test
public void deleteTest() {

  SysDept deptA = new SysDept("A", "deptA");
  List<SysDept> depts = new ArrayList<>();
  depts.addAll(Arrays.asList(deptA));
  for (SysDept dept : depts) {
    Response response = sysDeptRestApi.add(dept);
    CommonDataTest.assertDeptResponseSuccess(response);
  }
  for (SysDept dept : depts) {
    Response response = sysDeptRestApi.delete(dept.getId(), 1);
    CommonDataTest.assertDeptResponseSuccess(response);
  }
  JsonResponse<ListResult<SysDeptTree>> response2 = CommonDataTest.queryDeptTreeList();
  assertTrue(response2.getSuccess());
  for (SysDeptTree deptTree : response2.getResult().getRecords()) {
    assertTrue(deptTree.getDeleted() == 1);
  }
}