@Test
public void editTest() {

  SysDept deptA = new SysDept("A", "deptA");
  Response response = sysDeptRestApi.add(deptA);
  CommonDataTest.assertDeptResponseSuccess(response);
  // modify
  deptA.setDeptCode("A-modify");
  deptA.setDeptName("deptA-modify");
  deptA.setParentCode("A-modify");
  deptA.setDeleted(5);
  deptA.setDescription("desc");
  deptA.setSortOrder(9);
  response = sysDeptRestApi.edit(deptA);
  CommonDataTest.assertDeptResponseSuccess(response);
  // check
  JsonResponse<ListResult<SysDeptTree>> response4 = CommonDataTest.queryDeptTreeList();
  SysDeptTree sysDeptTree = response4.getResult().getRecords().get(0);
  assertEquals(sysDeptTree.getDeptCode(), deptA.getDeptCode());
  assertEquals(sysDeptTree.getDeptName(), deptA.getDeptName());
  assertEquals(sysDeptTree.getParentCode(), deptA.getParentCode());
  // NOTE: parent_name value is left join query
  assertEquals(sysDeptTree.getParentName(), "deptA-modify");
  assertEquals(sysDeptTree.getDeleted(), deptA.getDeleted());
  assertEquals(sysDeptTree.getDescription(), deptA.getDescription());
  assertEquals(sysDeptTree.getSortOrder(), deptA.getSortOrder());
}