@Test void testExecuteWithTarget() throws IOException { HttpClient httpClient = HttpMocks.mockClient(builder -> builder.addResponse(OK_RESPONSE)); HttpRequest request = Mockito.spy(new HttpGet()); HttpResponse response = getResultFromExecution(httpClient, "dummy", client -> client.execute(null, request, (HttpContext) null)); Mockito.verify(request, Mockito.never()) .setHeader(Mockito.anyString(), Mockito.anyString()); Assertions.assertEquals(200, response.getStatusLine() .getStatusCode()); }
@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; }