From 27b09430298efde3bd4d73de75646de0b336bc28 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Thu, 6 Jun 2024 11:24:09 -0400 Subject: [PATCH] Adjusty test for macOS --- .../java/org/apache/commons/io/file/PathUtilsTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/apache/commons/io/file/PathUtilsTest.java b/src/test/java/org/apache/commons/io/file/PathUtilsTest.java index 30acf45a5fd..cbf10bd5c02 100644 --- a/src/test/java/org/apache/commons/io/file/PathUtilsTest.java +++ b/src/test/java/org/apache/commons/io/file/PathUtilsTest.java @@ -254,15 +254,17 @@ public void testGetBaseNamePathCornerCases() { public void testGetDosFileAttributeView() { // dir final DosFileAttributeView dosFileAttributeView = PathUtils.getDosFileAttributeView(current()); + final Path path = Paths.get("this-file-does-not-exist-at.all"); + assertFalse(Files.exists(path)); if (SystemUtils.IS_OS_MAC) { assertNull(dosFileAttributeView); + // missing file + assertNull(PathUtils.getDosFileAttributeView(path)); } else { assertNotNull(dosFileAttributeView); + // missing file + assertNotNull(PathUtils.getDosFileAttributeView(path)); } - // missing file - final Path path = Paths.get("this-file-does-not-exist-at.all"); - assertFalse(Files.exists(path)); - assertNotNull(PathUtils.getDosFileAttributeView(path)); // null assertThrows(NullPointerException.class, () -> PathUtils.getDosFileAttributeView(null)); }