### Question:
FileOutputSignalHandler implements JRaftSignalHandler { protected File getOutputFile(final String path, final String baseFileName) throws IOException { makeDir(path); final String now = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss").format(new Date()); final String fileName = baseFileName + "." + now; final File file = Paths.get(path, fileName).toFile(); if (!file.exists() && !file.createNewFile()) { throw new IOException("Fail to create file: " + file); } return file; }    }### Answer:
@Test public void testGetOutputFileWithAbsolutePath() throws IOException { final String path = Paths.get("cde").toAbsolutePath().toString(); final File f = getOutputFile(path, "test3.log"); assertTrue(f.exists()); FileUtils.forceDelete(new File(path)); }
@Test public void testGetOutputFileWithEmptyPath() throws IOException { final File f = getOutputFile("", "test1.log"); assertTrue(f.exists()); FileUtils.forceDelete(f); }
@Test public void testGetOutputFileWithPath() throws IOException { final String path = "abc"; final File f = getOutputFile(path, "test2.log"); assertTrue(f.exists()); FileUtils.forceDelete(new File(path)); }