Skip to content

Commit

Permalink
Update UtilsTests.java (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
arifBurakDemiray authored Feb 22, 2024
1 parent 1348243 commit 47e7a33
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,12 @@ public void readFileContent_fileNotReadable() throws IOException {
BufferedWriter writer = Files.newBufferedWriter(file.toPath());
writer.write(fileContent);
writer.close();
Files.setPosixFilePermissions(file.toPath(), EnumSet.of(PosixFilePermission.OWNER_WRITE));

String content = Utils.readFileContent(file, logger);
if (System.getProperty("os.name").toLowerCase().contains("win")) {
Assert.assertEquals(fileContent, content);
Assert.assertEquals(fileContent, Utils.readFileContent(file, logger));
} else {
Assert.assertEquals("", content);
Files.setPosixFilePermissions(file.toPath(), EnumSet.of(PosixFilePermission.OWNER_WRITE));
Assert.assertEquals("", Utils.readFileContent(file, logger));
}
} finally {
File file = new File(TEST_FILE_NAME);
Expand Down

0 comments on commit 47e7a33

Please sign in to comment.