### Question:
HttpUtils { public static String getResponseContentString(HttpGet httpget, CloseableHttpClient httpClient) { String responseContent = null; CloseableHttpResponse response = null; try { response = httpClient.execute(httpget); if (response.getStatusLine().getStatusCode() == 200) { HttpEntity entity = response.getEntity(); if (entity != null) { responseContent = EntityUtils.toString(entity, Constants.UTF_8); } else { logger.warn("http entity is null"); } } else { logger.error("http get:{} response status code is not 200!", response.getStatusLine().getStatusCode()); } } catch (IOException ioe) { logger.error(ioe.getMessage(), ioe); } finally { try { if (response != null) { EntityUtils.consume(response.getEntity()); response.close(); } } catch (IOException e) { logger.error(e.getMessage(), e); } if (!httpget.isAborted()) { httpget.releaseConnection(); httpget.abort(); } } return responseContent; } private  HttpUtils(); static CloseableHttpClient getInstance(); static String get(String url); static String getResponseContentString(HttpGet httpget, CloseableHttpClient httpClient); static final Logger logger; }### Answer:
@Test public void testGetResponseContentString() { CloseableHttpClient httpclient = HttpClients.createDefault(); HttpGet httpget = new HttpGet("https: RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(Constants.HTTP_CONNECT_TIMEOUT) .setConnectionRequestTimeout(Constants.HTTP_CONNECTION_REQUEST_TIMEOUT) .setSocketTimeout(Constants.SOCKET_TIMEOUT).setRedirectsEnabled(true).build(); httpget.setConfig(requestConfig); String responseContent = HttpUtils.getResponseContentString(httpget, httpclient); Assert.assertNotNull(responseContent); }