SecurityConfig { public PoolingHttpClientConnectionManager createManager() { PoolingHttpClientConnectionManager manager = new PoolingHttpClientConnectionManager(buildSocketFactory(), null, null, null, config.getTTL(), TimeUnit.MILLISECONDS); manager.setMaxTotal(config.getMaxConnections()); manager.setDefaultMaxPerRoute(config.getMaxPerRoutes()); return manager; } SecurityConfig(Config config); PoolingHttpClientConnectionManager createManager(); void configureSecurity(HttpClientBuilder cb);  }
@Test public void willTakeConfigIntoAccountWhenCreatingManager() { Config config = new Config().concurrency(88, 42); SecurityConfig sec = new SecurityConfig(config); PoolingHttpClientConnectionManager manager = sec.createManager(); assertEquals(88, manager.getMaxTotal()); assertEquals(42, manager.getDefaultMaxPerRoute()); }