KeeperContainerServiceImpl extends AbstractConsoleService<KeepercontainerTblDao> implements KeeperContainerService { protected boolean checkIpAndPort(String host, int port) { getOrCreateRestTemplate(); String url = "http: try { return restTemplate.getForObject(String.format(url, host, port), Boolean.class); } catch (RestClientException e) { logger.error("[healthCheck]Http connect occur exception. ", e); } return false; }  @Override KeepercontainerTbl find(final long id); @Override List<KeepercontainerTbl> findAllByDcName(final String dcName); @Override List<KeepercontainerTbl> findAllActiveByDcName(String dcName); @Override List<KeepercontainerTbl> findKeeperCount(String dcName); @Override List<KeepercontainerTbl> findBestKeeperContainersByDcCluster(String dcName, String clusterName); @Override void addKeeperContainer(final KeeperContainerCreateInfo createInfo); @Override List<KeeperContainerCreateInfo> getDcAllKeeperContainers(String dc); @Override void updateKeeperContainer(KeeperContainerCreateInfo createInfo); @Override List<KeeperContainerInfoModel> findAllInfos();  }
@Test @Ignore public void testCheckHostAndPort() { boolean result = keeperContainerService.checkIpAndPort("10.2.73.161", 8080); Assert.assertTrue(result); }