DeployClient implements IDeployClient { @Override public IIndexDeployFuture addIndex(String indexName, String indexPath, int replicationLevel) { validateIndexData(indexName, replicationLevel); _protocol.addMasterOperation(new IndexDeployOperation(indexName, indexPath, replicationLevel)); return new IndexDeployFuture(_protocol, indexName); } DeployClient(ZkClient zkClient, ZkConfiguration configuration);  DeployClient(InteractionProtocol interactionProtocol); @Override IIndexDeployFuture addIndex(String indexName, String indexPath, int replicationLevel); @Override void removeIndex(String indexName); @Override boolean existsIndex(String indexName); @Override IndexMetaData getIndexMetaData(String indexName); @Override List<String> getIndices();  }
@Test public void testAddIndex() throws Exception { DeployClient deployClient = new DeployClient(_protocol); deployClient.addIndex("i1", "iP", 1); verify(_protocol).addMasterOperation(any(IndexDeployOperation.class)); }
@Test(expected = IllegalArgumentException.class) public void testAddIndexWithInvalidReplicationCount() throws Exception { DeployClient deployClient = new DeployClient(_protocol); deployClient.addIndex("i1", "iP", 0); }
@Test(expected = IllegalArgumentException.class) public void testAddIndexWithInvalidName() throws Exception { DeployClient deployClient = new DeployClient(_protocol); deployClient.addIndex("*", "iP", 1); }
@Test(expected = IllegalArgumentException.class) public void testAddIndexWithInvalidName2() throws Exception { DeployClient deployClient = new DeployClient(_protocol); deployClient.addIndex("a" + AbstractIndexOperation.INDEX_SHARD_NAME_SEPARATOR, "iP", 1); }