config.setHttpEnabled(false);
createServer();
server.start();
try (HttpClient client = new JettyHttpClient(new HttpClientConfig().setConnectTimeout(new Duration(2.0, TimeUnit.SECONDS)))) {
StatusResponse response = client.execute(prepareGet().setUri(httpServerInfo.getHttpUri().resolve("/")).build(), createStatusResponseHandler());
if (response != null) { // TODO: this is a workaround for a bug in AHC (some race condition)
fail("Expected connection refused, got response code: " + response.getStatusCode());
}
}