SolrCreationManager extends SolrManager { public Cluster createCluster(String name, Integer size) throws InterruptedException, URISyntaxException { SolrClusterOptions options = new SolrClusterOptions(name, size); SolrCluster cluster = service.createSolrCluster(options); log.info(Messages.getString("RetrieveAndRank.CLUSTER_CREATING")); while (cluster.getStatus() == Status.NOT_AVAILABLE) { log.info(Messages.getString("RetrieveAndRank.CLUSTER_WAITING")); cluster = service.getSolrCluster(cluster.getId()); Thread.sleep(10000); } log.info("SOLR_CLUSTER_ID = " + cluster.getId()); log.info(Messages.getString("RetrieveAndRank.CLUSTER_READY")); return new Cluster(this, cluster.getId()); } SolrCreationManager(String username, String password, String rnr_endpoint); Cluster createCluster(String name, Integer size); static void main(String[] args);  }
@Test public void test_create_cluster() throws InterruptedException, URISyntaxException { GIVEN.create_creation_manager(); THEN.mockedCreationManager.createCluster("name", 0); }
@Test(expected = URISyntaxException.class) public void test_fail_create_cluster() throws InterruptedException, URISyntaxException, SolrServerException, IOException { GIVEN.creation_manager_is_from_invalid_url(); THEN.mockedCreationManager.createCluster("name", 0); }