Cluster { public void deleteConfiguration(String config_name) throws SolrServerException { checkStatus(); log.info(Messages.getString("RetrieveAndRank.CONFIG_DELETING")); service.deleteSolrClusterConfiguration(id, config_name); log.info(Messages.getString("RetrieveAndRank.CONFIG_DELETED")); } 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 = SolrServerException.class) public void delete_bad_configuration() throws SolrServerException, URISyntaxException { WHEN.create_deletion_manager(); THEN.config_name = "doesn't exit config"; THEN.create_cluster(mockedDeletionManager, "some_id", "some_name", "some_size"); THEN.cluster.deleteConfiguration(config_name); }
@Test public void test_delete_config() throws SolrServerException, URISyntaxException { String config_name = "some_config"; String cluster_id = "some_id"; WHEN.create_deletion_manager(); AND.create_cluster(mockedDeletionManager, cluster_id, "some_name", "some_size"); AND.cluster_has_config(config_name); AND.manager_has_cluster(mockedDeletionManager, cluster_id); THEN.cluster.deleteConfiguration(config_name);; }
@Test(expected = SolrServerException.class) public void test_delete_wrong_config() throws SolrServerException, URISyntaxException { String config_name = "some_config"; String cluster_id = "some_id"; WHEN.create_deletion_manager(); AND.create_cluster(mockedDeletionManager, cluster_id, "some_name", "some_size"); AND.cluster_has_config(config_name); AND.manager_has_cluster(mockedDeletionManager, cluster_id); THEN.cluster.deleteConfiguration("a different config"); }