RestFunctions { protected static PoolingHttpClientConnectionManager getConnectionManager(RestConfig restConfig) { PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(); if (restConfig.containsKey(POOLING_MAX_TOTAL)) { cm.setMaxTotal(restConfig.getPoolingMaxTotal()); } if (restConfig.containsKey(POOLING_DEFAULT_MAX_PER_RUOTE)) { cm.setDefaultMaxPerRoute(restConfig.getPoolingDefaultMaxPerRoute()); } return cm; }  static T getArg(int index, Class<T> clazz, List<Object> args);  }
@Test public void restGetShouldGetPoolingConnectionManager() { RestConfig restConfig = new RestConfig(); restConfig.put(POOLING_MAX_TOTAL, 5); restConfig.put(POOLING_DEFAULT_MAX_PER_RUOTE, 2); PoolingHttpClientConnectionManager cm = RestFunctions.getConnectionManager(restConfig); assertEquals(5, cm.getMaxTotal()); assertEquals(2, cm.getDefaultMaxPerRoute()); }