DatabaseService { public ListResult<DataBaseView> findDbPageList(Paging<DataBaseInfo> paging) throws SQLException { Long count = dataBaseDao.getTotalCount(paging); return PagerUtil.find(count, paging.getPage(), paging.getPageSize(), () -> { List<DataBaseView> list = dataBaseDao.findDbPageList(paging); for (DataBaseView dataBaseView : list) { dataBaseView.setDb_password(DasEnv.encdecConfiguration.decrypt(dataBaseView.getDb_password())); } if (CollectionUtils.isEmpty(list)) { return Collections.emptyList(); } return list; }); }  ValidatorChain validatePermision(LoginUser user, Errors errors); ServiceResult isExist(List<String> db_names); ServiceResult<String> addDataBaseInfo(LoginUser user, DataBaseInfo dataBaseInfo); ServiceResult<String> genDefaultDbsetAndEntry(DataBaseInfo dataBaseInfo); ServiceResult<String> genDefaultDbsetAndEntry(Long groupId, Long dbId, String dbname, Integer dbtype); boolean isNotExistByName(DataBaseInfo dataBaseInfo); ServiceResult<String> checkupdateDBInfo(DataBaseInfo dataBaseInfo); boolean updateDBInfo(DataBaseInfo dataBaseInfo); ListResult<DataBaseView> findDbPageList(Paging<DataBaseInfo> paging); ListResult<DataBaseView> findDbPageListByUserId(Paging<DataBaseInfo> paging, Long userId); ServiceResult encryptAndOptUser(LoginUser user, List<DataBaseInfo> dBList); ServiceResult<String> addDataBaseList(List<DataBaseInfo> dBList); ServiceResult<List<String>> getDBCatalogs(Long dbsetId); ServiceResult<List<String>> getDBCatalogsByDbId(Long dbid); ServiceResult connectionTest(ConnectionRequest connectionRequest); ServiceResult deleteCheck(Long dbId); ServiceResult<String> addDataCenter(LoginUser user, List<DataBaseInfo> list); ServiceResult<String> updateDataCenter(LoginUser user, DataBaseInfo dataBaseInfo); ServiceResult<String> deleteDataCenter(LoginUser user, DataBaseInfo dataBaseInfo); ServiceResult<String> syncDataCenter(LoginUser user, DataBaseInfo dataBaseInfo); ConfigCkeckResult<List<ConfigDataResponse>> getCheckData(LoginUser user, DataBaseInfo dataBaseInfo); ServiceResult getDataBaseButton(LoginUser user);  }
@Test public void findDbPageListTest() throws SQLException { ListResult<DataBaseView> listResult = new ListResult<>(); List<DataBaseView> list = Lists.newArrayList(DataBaseView.builder().id(1).dbname("tom").build()); listResult.setList(list); Paging<DataBaseInfo> paging = new Paging<>(); paging.setData(new DataBaseInfo()); Assert.assertTrue(databaseService.findDbPageList(paging).getList().size() == 1); }