AppGroupService { public boolean isNotExistByName(AppGroup appGroup) throws SQLException { Long n = appGroupDao.getCountByName(appGroup.getName()); Long i = appGroupDao.getCountByIdAndName(appGroup.getId(), appGroup.getName()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }  ValidatorChain validatePermision(LoginUser user, Errors errors); ListResult<AppGroupView> findProjectGroupPageList(Paging<AppGroup> paging); ServiceResult<String> insertAppGroup(AppGroup appGroup); ServiceResult deleteCheck(Long dbsetId); ServiceResult<String> deleteAppGroup(AppGroup appGroup); ServiceResult<String> updateAppGroup(AppGroup appGroup); boolean isNotExistByName(AppGroup appGroup);  }
@Test public void isNotExistByNameTest() throws SQLException { AppGroup appGroup = AppGroup.builder().id(1L).build(); Assert.assertTrue(appGroupService.isNotExistByName(appGroup)); }