@Test
public void dumpPageHistoryToCustomAbsoluteDir() throws Exception {

    Path path = Paths.get(U.defaultWorkDirectory(), TEST_DUMP_PAGE_FILE);
    try {
        diagnosticProcessor.dumpPageHistory(new PageHistoryDiagnoster.DiagnosticPageBuilder()
            .pageIds(expectedPageId)
            .folderForDump(path.toFile())
            .addAction(PRINT_TO_FILE)
        );
        File dumpFile = path.toFile().listFiles((dir, name) -> name.endsWith(FILE_FORMAT))[0];
        List<String> records = Files.readAllLines(dumpFile.toPath());
        assertTrue(!records.isEmpty());
        assertTrue(records.stream().anyMatch(line -> line.contains("CheckpointRecord")));
    }
    finally {
        U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), TEST_DUMP_PAGE_FILE, false));
    }
}