HttpClientHttpChannelFactory implements HttpChannelFactory, Disposable { public void dispose() { client.getConnectionManager().shutdown(); } HttpClientHttpChannelFactory(HttpClient client);  HttpClientHttpChannelFactory(CRestConfig crestConfig); HttpChannel open(MethodType methodType, String url, Charset charset); void dispose(); static final String HTTP_CLIENT_PROP; }
@Test public void disposeShouldShutdownConnectionManager(){ ClientConnectionManager clientConnectionManager = mock(ClientConnectionManager.class); when(client.getConnectionManager()).thenReturn(clientConnectionManager); toTest.dispose(); verify(clientConnectionManager).shutdown(); }