Skip to content

Commit a0c1482

Browse files
committed
Add PathUtilsTest.testSetReadOnlyFileAbsent()
1 parent 27b0943 commit a0c1482

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/test/java/org/apache/commons/io/file/PathUtilsTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,11 @@ public void testSetReadOnlyFile() throws IOException {
540540
PathUtils.deleteFile(resolved);
541541
}
542542

543+
@Test
544+
public void testSetReadOnlyFileAbsent() {
545+
assertThrows(IOException.class, () -> PathUtils.setReadOnly(Paths.get("does-not-exist-at-all-ever-never"), true));
546+
}
547+
543548
@Test
544549
public void testTouch() throws IOException {
545550
assertThrows(NullPointerException.class, () -> FileUtils.touch(null));

0 commit comments

Comments
 (0)