Cluster { @SuppressWarnings("unchecked") public List<String> listCollections() throws SolrServerException, IOException { checkStatus(); final CollectionAdminRequest.List listCollectionRequest = new CollectionAdminRequest.List(); final CollectionAdminResponse listResponse = listCollectionRequest.process(solrClient); final List<String> collections = (List<String>) listResponse.getResponse().get("collections"); if (!listResponse.isSuccess()) { return collections; } else { String errorMsg = MessageFormat.format(Messages.getString("RetrieveAndRank.COLLECTION_LIST"), listResponse); throw new SolrServerException(errorMsg); } } Cluster(SolrManager solrManager, String id); Status getStatus(); String getID(); void uploadConfiguration(String config_name, String path_config_zip); void deleteConfiguration(String config_name); @SuppressWarnings("unchecked") List<String> listCollections(); Collection getCollection(String collection_name); void clean(); Collection createCollection(String collection_name, String config_name); void waitTillReady(long interval);  }
@Test(expected = NullPointerException.class) public void cluster_from_empty_manager() throws SolrServerException, IOException, URISyntaxException { mockedCreationManager = mock(SolrCreationManager.class); Cluster cluster = new Cluster(mockedCreationManager, null); cluster.listCollections(); }