TerminalHttpConnectionServerChecker extends HttpConnectionServerChecker { @Override boolean isConnectionSuccessful(HttpURLConnection conn) { try { int responseCode = conn.getResponseCode(); return responseCode == 404; } catch (IOException e) { return false; } } TerminalHttpConnectionServerChecker(
      URL url,
      String machineName,
      String serverRef,
      long period,
      long timeout,
      int successThreshold,
      TimeUnit timeUnit,
      Timer timer,
      String token);   }
@Test public void shouldConfirmConnectionSuccessIfResponseCodeIs404() throws Exception { when(conn.getResponseCode()).thenReturn(404); assertTrue(checker.isConnectionSuccessful(conn)); }
@Test public void shouldNotConfirmConnectionSuccessIfResponseCodeIsNot404() throws Exception { when(conn.getResponseCode()).thenReturn(200); assertFalse(checker.isConnectionSuccessful(conn)); }