@Test public void testRequestsWithContent() throws IOException { HttpClient mockClient = mock(HttpClient.class); HttpResponse mockResponse = mock(HttpResponse.class); when(mockClient.execute(any(HttpUriRequest.class))).thenReturn(mockResponse); ApacheHttpTransport transport = new ApacheHttpTransport(mockClient); subtestUnsupportedRequestsWithContent( transport.buildRequest("GET", "http: subtestUnsupportedRequestsWithContent( transport.buildRequest("DELETE", "http: subtestUnsupportedRequestsWithContent( transport.buildRequest("HEAD", "http: execute(transport.buildRequest("PATCH", "http: execute(transport.buildRequest("PUT", "http: execute(transport.buildRequest("POST", "http: execute(transport.buildRequest("PATCH", "http: }
@Override protected ApacheHttpRequest buildRequest(String method, String url) { HttpRequestBase requestBase; if (method.equals(HttpMethods.DELETE)) { requestBase = new HttpDelete(url); } else if (method.equals(HttpMethods.GET)) { requestBase = new HttpGet(url); } else if (method.equals(HttpMethods.HEAD)) { requestBase = new HttpHead(url); } else if (method.equals(HttpMethods.PATCH)) { requestBase = new HttpPatch(url); } else if (method.equals(HttpMethods.POST)) { requestBase = new HttpPost(url); } else if (method.equals(HttpMethods.PUT)) { requestBase = new HttpPut(url); } else if (method.equals(HttpMethods.TRACE)) { requestBase = new HttpTrace(url); } else if (method.equals(HttpMethods.OPTIONS)) { requestBase = new HttpOptions(url); } else { requestBase = new HttpExtensionMethod(method, url); } return new ApacheHttpRequest(httpClient, requestBase); }
ApacheHttpTransport extends HttpTransport { @Override protected ApacheHttpRequest buildRequest(String method, String url) { HttpRequestBase requestBase; if (method.equals(HttpMethods.DELETE)) { requestBase = new HttpDelete(url); } else if (method.equals(HttpMethods.GET)) { requestBase = new HttpGet(url); } else if (method.equals(HttpMethods.HEAD)) { requestBase = new HttpHead(url); } else if (method.equals(HttpMethods.PATCH)) { requestBase = new HttpPatch(url); } else if (method.equals(HttpMethods.POST)) { requestBase = new HttpPost(url); } else if (method.equals(HttpMethods.PUT)) { requestBase = new HttpPut(url); } else if (method.equals(HttpMethods.TRACE)) { requestBase = new HttpTrace(url); } else if (method.equals(HttpMethods.OPTIONS)) { requestBase = new HttpOptions(url); } else { requestBase = new HttpExtensionMethod(method, url); } return new ApacheHttpRequest(httpClient, requestBase); } }
ApacheHttpTransport extends HttpTransport { @Override protected ApacheHttpRequest buildRequest(String method, String url) { HttpRequestBase requestBase; if (method.equals(HttpMethods.DELETE)) { requestBase = new HttpDelete(url); } else if (method.equals(HttpMethods.GET)) { requestBase = new HttpGet(url); } else if (method.equals(HttpMethods.HEAD)) { requestBase = new HttpHead(url); } else if (method.equals(HttpMethods.PATCH)) { requestBase = new HttpPatch(url); } else if (method.equals(HttpMethods.POST)) { requestBase = new HttpPost(url); } else if (method.equals(HttpMethods.PUT)) { requestBase = new HttpPut(url); } else if (method.equals(HttpMethods.TRACE)) { requestBase = new HttpTrace(url); } else if (method.equals(HttpMethods.OPTIONS)) { requestBase = new HttpOptions(url); } else { requestBase = new HttpExtensionMethod(method, url); } return new ApacheHttpRequest(httpClient, requestBase); } ApacheHttpTransport();  ApacheHttpTransport(HttpClient httpClient); }
ApacheHttpTransport extends HttpTransport { @Override protected ApacheHttpRequest buildRequest(String method, String url) { HttpRequestBase requestBase; if (method.equals(HttpMethods.DELETE)) { requestBase = new HttpDelete(url); } else if (method.equals(HttpMethods.GET)) { requestBase = new HttpGet(url); } else if (method.equals(HttpMethods.HEAD)) { requestBase = new HttpHead(url); } else if (method.equals(HttpMethods.PATCH)) { requestBase = new HttpPatch(url); } else if (method.equals(HttpMethods.POST)) { requestBase = new HttpPost(url); } else if (method.equals(HttpMethods.PUT)) { requestBase = new HttpPut(url); } else if (method.equals(HttpMethods.TRACE)) { requestBase = new HttpTrace(url); } else if (method.equals(HttpMethods.OPTIONS)) { requestBase = new HttpOptions(url); } else { requestBase = new HttpExtensionMethod(method, url); } return new ApacheHttpRequest(httpClient, requestBase); } ApacheHttpTransport();  ApacheHttpTransport(HttpClient httpClient); static HttpClient newDefaultHttpClient(); static HttpClientBuilder newDefaultHttpClientBuilder(); @Override boolean supportsMethod(String method); @Override void shutdown(); HttpClient getHttpClient(); }
ApacheHttpTransport extends HttpTransport { @Override protected ApacheHttpRequest buildRequest(String method, String url) { HttpRequestBase requestBase; if (method.equals(HttpMethods.DELETE)) { requestBase = new HttpDelete(url); } else if (method.equals(HttpMethods.GET)) { requestBase = new HttpGet(url); } else if (method.equals(HttpMethods.HEAD)) { requestBase = new HttpHead(url); } else if (method.equals(HttpMethods.PATCH)) { requestBase = new HttpPatch(url); } else if (method.equals(HttpMethods.POST)) { requestBase = new HttpPost(url); } else if (method.equals(HttpMethods.PUT)) { requestBase = new HttpPut(url); } else if (method.equals(HttpMethods.TRACE)) { requestBase = new HttpTrace(url); } else if (method.equals(HttpMethods.OPTIONS)) { requestBase = new HttpOptions(url); } else { requestBase = new HttpExtensionMethod(method, url); } return new ApacheHttpRequest(httpClient, requestBase); } ApacheHttpTransport();  ApacheHttpTransport(HttpClient httpClient); static HttpClient newDefaultHttpClient(); static HttpClientBuilder newDefaultHttpClientBuilder(); @Override boolean supportsMethod(String method); @Override void shutdown(); HttpClient getHttpClient();  }