OctopusConnectivityChecker { public String checkOctopusConnectivity(UUID correlationId) { try { LOG.info(String.format("%s: checking connectivity to octopus at %s", correlationId, contentProvider.getUrl())); contentProvider.getOctopusContent(CacheManager.CacheNames.NoCache, "/api", correlationId); return null; } catch (UnexpectedResponseCodeException e) { return e.getMessage(); } catch (Throwable e) { return e.getMessage(); } } OctopusConnectivityChecker(String octopusUrl, String apiKey, Integer connectionTimeout, CacheManager cacheManager, MetricRegistry metricRegistry);   OctopusConnectivityChecker(HttpContentProvider contentProvider); String checkOctopusConnectivity(UUID correlationId);  }
@Test(groups = {"needs-real-server"}) public void check_octopus_connectivity_against_real_server() throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException { final String realOctopusUrl = "http: final Integer timeoutInMilliseconds = 30000; OctopusConnectivityChecker sut = new OctopusConnectivityChecker(realOctopusUrl, "", timeoutInMilliseconds, new FakeCacheManager(), new FakeMetricRegistry()); UUID correlationId = UUID.randomUUID(); String result = sut.checkOctopusConnectivity(correlationId); Assert.assertEquals(result, null); }