DatabaseSetEntryService { public boolean isNotExistByName(DatabaseSetEntry databasesetentry) throws SQLException { Long n = dataBaseSetEntryDao.getCountByName(databasesetentry.getName()); Long i = dataBaseSetEntryDao.getCountByIdAndName(databasesetentry.getId(), databasesetentry.getName()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }  ListResult<DatabaseSetEntryView> findDbSetEntryPageList(Paging<DatabaseSetEntry> paging); boolean isNotExistByName(DatabaseSetEntry databasesetentry); boolean insertDatabaseSetEntry(DatabaseSetEntry databasesetentry); ServiceResult<String> addDatabaseSetEntryList(LoginUser user, List<DatabaseSetEntry> dBList); List<String> getNamesByEntryIds(List<Integer> dbset_ids); ServiceResult<String> addDataCenterEntryList(LoginUser user, List<DatabaseSetEntry> dBList); ServiceResult<String> updateDataCenter(LoginUser user, DatabaseSetEntry newDbSetEntry); ServiceResult<String> deleteDataCenter(LoginUser user, DatabaseSetEntry dbsetEntry); ServiceResult<String> syncDbsetEntry(LoginUser user, DatabaseSetEntry dbsetEntry); ConfigCkeckResult<List<ConfigDataResponse>> getCheckData(LoginUser user, DatabaseSetEntry dbsetEntry); ServiceResult getDbSetEntryButton(LoginUser user);  }
@Test public void isNotExistByNameTest() throws SQLException { DatabaseSetEntry databaseSetEntry = DatabaseSetEntry.builder().db_Id(1L).build(); Assert.assertTrue(databaseSetEntryService.isNotExistByName(databaseSetEntry)); }