LocalFileStore implements FileStore { @Override public void deleteFile(String fileName) throws IllegalArgumentException { File templateFile = new File(templateDirectory, fileName); if (!templateFile.exists()) { throw new IllegalArgumentException("file " + fileName); } templateFile.delete(); } LocalFileStore(); void setTemplateDirectory(File templateDirectory); @Override OutputStream getOutStream(String fileName); @Override void deleteFile(String fileName);  }
@Test public void deleteFile() throws IOException { final String fileName = "fileStoreTest.txt"; File file = new File(tempDir, fileName); assertTrue(file.createNewFile()); LocalFileStore fileStore = new LocalFileStore(); fileStore.setTemplateDirectory(tempDir); fileStore.deleteFile(fileName); assertFalse(file.exists()); }