### Question:
ClearIndexAction extends AbstractIndexingAction { @Override public void performAction(SolrUpdateRequest updateRequest) throws IndexingException { solrUpdateDriver.deleteByQuery("*:*"); solrUpdateDriver.commit(); }  @Override void performAction(SolrUpdateRequest updateRequest);  }### Answer:
@Test public void testDeleteAll() throws Exception { SolrDocumentList docListBefore = getDocumentList(); assertEquals("Index should contain contents before delete", 4, docListBefore.size()); ClearIndexAction action = new ClearIndexAction(); action.setSolrUpdateDriver(driver); SolrUpdateRequest request = mock(SolrUpdateRequest.class); action.performAction(request); SolrDocumentList docListAfter = getDocumentList(); assertEquals("Index must be empty after delete all", 0, docListAfter.size()); }