Cluster { public void uploadConfiguration(String config_name, String path_config_zip) throws SolrServerException { checkStatus(); log.info(Messages.getString("RetrieveAndRank.CONFIG_UPLOADING")); service.uploadSolrClusterConfigurationDirectory(id, config_name, new File(path_config_zip)); log.info(Messages.getString("RetrieveAndRank.CONFIG_UPLOADED")); } 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 public void test_upload_configuration() throws URISyntaxException, SolrServerException { String cluster_id = "some_id"; GIVEN.create_creation_manager(); WHEN.manager_has_cluster(mockedCreationManager, cluster_id); AND.create_cluster(mockedCreationManager, cluster_id, "some_name", "some_size"); THEN.cluster.uploadConfiguration("test-config", "zip"); }
@Test(expected = SolrServerException.class) public void test_upload_configuration_twice() throws URISyntaxException, SolrServerException { String cluster_id = "some_id"; String config_name = "some-config"; WHEN.create_creation_manager(); AND.manager_has_cluster(mockedCreationManager, cluster_id); THEN.create_cluster(mockedCreationManager, cluster_id, "some_name", "some_size"); THEN.cluster.uploadConfiguration(config_name, "zip"); THEN.cluster_has_config(config_name); THEN.cluster.uploadConfiguration(config_name, "zip"); }