GroupDatabaseService { public boolean isGroupHadDB(Long dbId, Long groupId) throws SQLException { DataBaseInfo dataBaseInfo = dataBaseDao.getDataBaseInfoByDbId(dbId); if (null != dataBaseInfo && null != dataBaseInfo.getDal_group_id() && dataBaseInfo.getDal_group_id().equals(groupId)) { return true; } return false; }  ValidatorChain validatePermision(LoginUser user, Errors errors); boolean isGroupHadDB(Long dbId, Long groupId); boolean isGroupHadDB(DataBaseInfo dataBaseModel); boolean validateTransferPermision(Long userId, Long dbId);  }
@Test public void isGroupHadDBTest() throws SQLException { Assert.assertTrue(groupDatabaseService.isGroupHadDB(1L, 1L)); }
@Test public void isGroupHadDBTest2() throws SQLException { DataBaseInfo dalGroupDB = DataBaseInfo.builder().dbname("name").build(); Assert.assertTrue(groupDatabaseService.isGroupHadDB(dalGroupDB)); }