@Test public void testBasicAuthException() throws Exception { startWithHandler(new AbstractHandler() { @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { baseRequest.setHandled(true); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }); final String url = "http: final String urlWithoutAuth = "http: httpClient.send(HttpRequestBuilder.<Integer>forUrl(url) .successHandler((httpRequest, is, statusCode, e) -> { fail(); return null; }) .errorHandler((httpRequest, is, statusCode, e) -> { assertThat(statusCode).isEqualTo(401); assertThat(e.getMessage()) .doesNotContain(url) .contains(urlWithoutAuth); return null; }) .build()); }
public void send(String method, String url, final List<String> requestBodyLines) { send(HttpRequestBuilder.<Integer>forUrl(url) .method(method) .body(requestBodyLines) .build()); }
HttpClient { public void send(String method, String url, final List<String> requestBodyLines) { send(HttpRequestBuilder.<Integer>forUrl(url) .method(method) .body(requestBodyLines) .build()); } }
HttpClient { public void send(String method, String url, final List<String> requestBodyLines) { send(HttpRequestBuilder.<Integer>forUrl(url) .method(method) .body(requestBodyLines) .build()); }  }
HttpClient { public void send(String method, String url, final List<String> requestBodyLines) { send(HttpRequestBuilder.<Integer>forUrl(url) .method(method) .body(requestBodyLines) .build()); }  void send(String method, String url, final List<String> requestBodyLines); T send(final String method, final String url, final Map<String, String> headerFields,
					  OutputStreamHandler outputStreamHandler, ResponseHandler<T> responseHandler); T send(final HttpRequest<T> request); static String getBasicAuthFromUserInfo(URL url); static String removeUserInfo(String url); }
HttpClient { public void send(String method, String url, final List<String> requestBodyLines) { send(HttpRequestBuilder.<Integer>forUrl(url) .method(method) .body(requestBodyLines) .build()); }  void send(String method, String url, final List<String> requestBodyLines); T send(final String method, final String url, final Map<String, String> headerFields,
					  OutputStreamHandler outputStreamHandler, ResponseHandler<T> responseHandler); T send(final HttpRequest<T> request); static String getBasicAuthFromUserInfo(URL url); static String removeUserInfo(String url);  }