PublicStrategyService { public boolean isNotExistByName(PublicStrategy publicStrategy) throws SQLException { Long n = publicStrategyDao.getCountByName(publicStrategy.getName()); Long i = publicStrategyDao.getCountByIdAndName(publicStrategy.getId(), publicStrategy.getName()); if (n == 0 || (n == 1 && i == 1)) { return true; } return false; }  ValidatorChain validatePermision(LoginUser user, Errors errors); ListResult<PublicStrategyView> findPublicShardingStrategyPageList(Paging<PublicStrategy> paging); boolean isNotExistByName(PublicStrategy publicStrategy); String getStrategyClassName(DatabaseSet databaseSet);  }
@Test public void isNotExistByNameTest() throws SQLException { PublicStrategy publicStrategy = PublicStrategy.builder().id(1L).name("name").build(); Assert.assertTrue(publicStrategyService.isNotExistByName(publicStrategy)); }