### Question:
ExportTreeManager { FileWriter getNextExportFile() throws IOException { return fileUtilsWrapper.getFileWriter(new File(buildExportFilePath(subDir))); } ExportTreeManager(String subDir);   ExportTreeManager(FileUtilsWrapper fileUtilsWrapper, String subDir);   }### Answer:
@Test public void getNextExportFile() throws IOException { doReturn(externalRoot).when(fileUtilsWrapper).getCineLogRoot(); doReturn("/root/CineLog").when(externalRoot).getAbsolutePath(); String path = "/root/CineLog/saves/movie/export" + new SimpleDateFormat("yyyyMMdd").format(new Date()) + ".csv"; FileWriter fileWriter = mock(FileWriter.class); doReturn(fileWriter).when(fileUtilsWrapper).getFileWriter(new File(path)); assertEquals( fileWriter, new ExportTreeManager(fileUtilsWrapper, "movie").getNextExportFile() ); }