UserService { public boolean canUpdateOrDeleteUser(LoginUser currentUser, LoginUser newUser) throws SQLException { if (permissionService.isSuperManagerById(currentUser.getId())) { return true; } return canUpdateOrDeleteUser(currentUser.getId(), currentUser.getRole(), newUser.getId(), newUser.getRole()); }  ValidatorChain validatePermision(LoginUser user, Errors errors); boolean canUpdateOrDeleteUser(LoginUser currentUser, LoginUser newUser); boolean canUpdateOrDeleteUser(Long userId, Integer userRole, Long newUserId, Integer newUserRole); boolean addUser(LoginUser user); boolean update(LoginUser user); ListResult<LoginUserView> findUserPageList(Paging<LoginUser> paging); boolean initAdminInfo(LoginUser user); boolean register(LoginUser user); ServiceResult<LoginUser> getUserInfoByWorkName(LoginUser user, String name); ServiceResult getUserManageButton(LoginUser user);  }
@Test public void canUpdateOrDeleteUserTest() throws SQLException { Assert.assertTrue(userService.canUpdateOrDeleteUser(currentUser, newUser)); }
@Test public void canUpdateOrDeleteUserTest2() throws SQLException { Assert.assertTrue(userService.canUpdateOrDeleteUser(1L, 2, 3L, 4)); }