diff --git a/sdk-java/src/test/java/ly/count/sdk/java/internal/UtilsTests.java b/sdk-java/src/test/java/ly/count/sdk/java/internal/UtilsTests.java index 471a6bf8..1b409e27 100644 --- a/sdk-java/src/test/java/ly/count/sdk/java/internal/UtilsTests.java +++ b/sdk-java/src/test/java/ly/count/sdk/java/internal/UtilsTests.java @@ -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);