### Question:
CrawlStatusUpdaterBolt extends AbstractStatusUpdaterBolt implements
    RemovalListener<String, List<Tuple>>, BulkProcessor.Listener { protected String getIndexName(Metadata md) { String crawlId = md.getFirstValue("n52.crawl.id"); return indexName.replace("*", crawlId.toLowerCase()); } CrawlStatusUpdaterBolt();  CrawlStatusUpdaterBolt(String indexName); @Override void prepare(Map stormConf, TopologyContext context,
                        OutputCollector collector); @Override void cleanup(); @Override void store(String url, Status status, Metadata metadata,
                      Date nextFetch); void ack(Tuple t, String url); void onRemoval(RemovalNotification<String, List<Tuple>> removal); @Override void afterBulk(long executionId, BulkRequest request,
                          BulkResponse response); @Override void afterBulk(long executionId, BulkRequest request,
                          Throwable throwable); @Override void beforeBulk(long executionId, BulkRequest request);  }### Answer:
@Test public void testGetIndexNameStar() { String statusIndex = "crawlstatus-*"; CrawlStatusUpdaterBolt bolt = new CrawlStatusUpdaterBolt(statusIndex); Metadata md = new Metadata(); md.setValue("n52.crawl.id", "tEstCrawl"); assertEquals(bolt.getIndexName(md), "crawlstatus-testcrawl"); assertEquals(bolt.getIndexName(md), "crawlstatus-testcrawl"); }
@Test public void testGetIndexNameNoStar() { String statusIndex = "crawlstatus"; CrawlStatusUpdaterBolt bolt = new CrawlStatusUpdaterBolt(statusIndex); Metadata md = new Metadata(); md.setValue("n52.crawl.id", "tEstCrawl"); assertEquals(bolt.getIndexName(md), "crawlstatus"); }