HttpClientUtils { public static CloseableHttpClient buildHttpClient(int connectionTimeout, int readTimeout) { HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); httpClientBuilder.setDefaultRequestConfig(RequestConfig.custom().setConnectTimeout(connectionTimeout) .setConnectionRequestTimeout(connectionTimeout).setSocketTimeout(readTimeout).build()); return httpClientBuilder.build(); }  static CloseableHttpClient buildHttpClient(int connectionTimeout, int readTimeout);  }
@Test public void testBuildHttpClient() throws Exception { int connectionTimeout = 1; int readTimeout = 2; CloseableHttpClient client = HttpClientUtils.buildHttpClient(connectionTimeout, readTimeout); assertNotNull(client); }