@Test
void loadFileFailure(TemporaryFolder temporaryFolder) throws IOException {

    // this test does not run in windows machines because it's not possible to change file permissions to simulate reading failure.
    if (!POSIX_ENABLED) {
        return;
    }
    File file = new File(temporaryFolder.getRoot(), "static.properties");
    FileUtils.touch(file);
    Files.setPosixFilePermissions(file.toPath(), PosixFilePermissions.fromString("---------"));
    assertThrows(PropertyFileException.class, () -> loadExistingProperties(file));
    Files.setPosixFilePermissions(file.toPath(), PosixFilePermissions.fromString("rwxrwxrwx"));
    Files.delete(file.toPath());
}