@Test void testExecuteWithResponseHandler() throws IOException { HttpClient httpClient = HttpMocks.mockClient(builder -> builder.addResponse(OK_RESPONSE) .responseHandlerReturnValue(RESPONSE_HANDLER_RETURN_VALUE)); HttpRequest request = Mockito.spy(new HttpGet()); String result = getResultFromExecution(httpClient, client -> client.execute(null, request, response -> null)); Assertions.assertEquals(RESPONSE_HANDLER_RETURN_VALUE, result); }
@Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); }
CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } }
CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); }
CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpParams getParams(); @Override ClientConnectionManager getConnectionManager(); @Override HttpResponse execute(HttpUriRequest request); @Override HttpResponse execute(HttpUriRequest request, HttpContext context); @Override HttpResponse execute(HttpHost target, HttpRequest request); @Override HttpResponse execute(HttpHost target, HttpRequest request, HttpContext context); @Override T execute(HttpUriRequest request, ResponseHandler<? extends T> responseHandler); @Override T execute(HttpUriRequest request, ResponseHandler<? extends T> responseHandler, HttpContext context); @Override T execute(HttpHost target, HttpRequest request, ResponseHandler<? extends T> responseHandler); @Override T execute(HttpHost target, HttpRequest request, ResponseHandler<? extends T> responseHandler, HttpContext context); @Override void close(); }
CsrfHttpClient implements HttpClient, Closeable { @Override public HttpResponse execute(HttpUriRequest request) throws IOException { return executeRequest(request, () -> delegate.execute(request)); } CsrfHttpClient(HttpClient httpClient, String csrfGetTokenUrl, Map<String, String> httpRequestHeaders); @Override HttpParams getParams(); @Override ClientConnectionManager getConnectionManager(); @Override HttpResponse execute(HttpUriRequest request); @Override HttpResponse execute(HttpUriRequest request, HttpContext context); @Override HttpResponse execute(HttpHost target, HttpRequest request); @Override HttpResponse execute(HttpHost target, HttpRequest request, HttpContext context); @Override T execute(HttpUriRequest request, ResponseHandler<? extends T> responseHandler); @Override T execute(HttpUriRequest request, ResponseHandler<? extends T> responseHandler, HttpContext context); @Override T execute(HttpHost target, HttpRequest request, ResponseHandler<? extends T> responseHandler); @Override T execute(HttpHost target, HttpRequest request, ResponseHandler<? extends T> responseHandler, HttpContext context); @Override void close(); static final String CSRF_TOKEN_HEADER_NAME; static final String CSRF_TOKEN_HEADER_FETCH_VALUE; static final String CSRF_TOKEN_HEADER_REQUIRED_VALUE; }