From 06cf5973adb4c41c314fc28f4b8ab38f1c6dd012 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray <57103426+arifBurakDemiray@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:59:22 +0300 Subject: [PATCH] Update UtilsTests.java --- .../test/java/ly/count/sdk/java/internal/UtilsTests.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 d6e2bf8a..f24c94a3 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);