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)); }