ContentCacheImpl implements ContentCache { @Override public void deleteFile(String url) { File cacheFile = new File(getCacheFilePath(url)); cacheFile.delete(); }  @Override boolean contains(String contentUrl); boolean contains(Key key); void putIntoLookup(Key key, String value); String getCacheFilePath(String contentUrl); String getContentUrl(File file); @Override ContentReader getReader(String contentUrl); @Override boolean put(String contentUrl, ContentReader source); @Override void remove(String contentUrl); void removeAll(); @Override void deleteFile(String url); @Override ContentWriter getWriter(final String url); static String createNewCacheFilePath(); void setMemoryStore(SimpleCache<Key, String> memoryStore); void setCacheRoot(File cacheRoot); @Override File getCacheRoot(); void processFiles(FileHandler handler);  }
@Test public void deleteFile() { File cacheFile = tempfile(); assertTrue("Temp file should have been written", cacheFile.exists()); Mockito.when(contentCache.getCacheFilePath("url")).thenReturn(cacheFile.getAbsolutePath()); contentCache.deleteFile("url"); assertFalse("File should have been deleted", cacheFile.exists()); }