SolrClientFactory { protected static List<String> getZkHosts(Map<String, Object> globalConfig) { return Splitter.on(',').trimResults() .splitToList((String) globalConfig.getOrDefault(SOLR_ZOOKEEPER, "")); }  static SolrClient create(Map<String, Object> globalConfig); static void close();  }
@Test public void testGetZkHostsSingle() { Map<String, Object> globalConfig = new HashMap<String, Object>() {{ put(SOLR_ZOOKEEPER, " zookeeper:2181 "); }}; List<String> actual = SolrClientFactory.getZkHosts(globalConfig); List<String> expected = new ArrayList<>(); expected.add("zookeeper:2181"); assertEquals(expected, actual); }
@Test public void testGetZkHostsMultiple() { Map<String, Object> globalConfig = new HashMap<String, Object>() {{ put(SOLR_ZOOKEEPER, " zookeeper:2181 , zookeeper2:2181 "); }}; List<String> actual = SolrClientFactory.getZkHosts(globalConfig); List<String> expected = new ArrayList<>(); expected.add("zookeeper:2181"); expected.add("zookeeper2:2181"); assertEquals(expected, actual); }