@Override
    public void runCheck() throws PreflightCheckException {
        checkDatanodeLock(directories.getConfigurationTargetDir());
        checkDatanodeLock(directories.getLogsTargetDir());
    }
@Test
    void testLockCreation(@TempDir Path dataDir,
                          @TempDir Path logsDir,
                          @TempDir Path configDir) throws IOException {

        final Path logsDirLock = logsDir.resolve(DatanodeDirectoriesLockfileCheck.DATANODE_LOCKFILE);
        final Path configDirLock = configDir.resolve(DatanodeDirectoriesLockfileCheck.DATANODE_LOCKFILE);

        final PreflightCheck check = new DatanodeDirectoriesLockfileCheck(VALID_NODE_ID, new DatanodeDirectories(dataDir, logsDir, null, configDir));
        check.runCheck();

        Assertions.assertThat(Files.readString(logsDirLock)).isEqualTo(VALID_NODE_ID);
        Assertions.assertThat(Files.readString(configDirLock)).isEqualTo(VALID_NODE_ID);
    }