CallbackClient { public CallbackClient.Response callback(URL address) { final long t0 = currentTimeMillis(); try { ResponseEntity<String> httpResponse = httpClient.exchange( requestUri(address), POST, new HttpEntity<>("", requestHeaders()), String.class ); return new Response(httpResponse, t0); } catch (Exception e) { return new Response(e, t0); } } CallbackClient(RestTemplate httpClient);  CallbackClient(RestTemplate httpClient, String username, String password); CallbackClient.Response callback(URL address);  }
@Test public void givenCallbackListenerDoesNotRespondWhenSendingARequestThenResponseIsNotOk() throws IOException { givenCallbackListenerDoesNotRespond(); CallbackClient.Response response = callbackClient.callback(new URL("http: assertFalse(response.ok()); assertFalse(response.notFound()); }