RetrievalWorker implements Runnable { protected void deleteFile(File localFile) throws IOException { localFile.delete(); } RetrievalWorker(ContentItem contentItem,
                           RetrievalSource source,
                           File contentDir,
                           boolean overwrite,
                           OutputWriter outWriter,
                           boolean createSpaceDir,
                           boolean applyTimestamps); void run(); Map<String, String> retrieveFile(); Map<String, String> retrieveFile(RetrievalListener listener); File getLocalFile();  }
@Test public void testDeleteFile() throws Exception { RetrievalWorker worker = createRetrievalWorker(true); File localFile = new File(tempDir, "rename-test"); FileUtils.writeStringToFile(localFile, "test"); worker.deleteFile(localFile); assertFalse(localFile.exists()); }