ApplicationMasterRestClient implements Closeable { @Override public void close() throws IOException { httpClient.close(); } ApplicationMasterRestClient(CloseableHttpClient client, String amHostName, int amRpcPort); Map<String, Map<String, Object>> getMetrics(); Map<String, Object> getTaskContext(); Map<String, Object> getAmState(); Map<String, Object> getConfig(); @Override void close(); @Override String toString();  }
@Test public void testCloseMethodClosesHttpClient() throws IOException { ApplicationMasterRestClient client = new ApplicationMasterRestClient(mockClient, AM_HOST_NAME, AM_RPC_PORT); client.close(); verify(mockClient).close(); }