garydgregory commented on code in PR #486:
URL: https://github.com/apache/commons-io/pull/486#discussion_r1340316615
##########
src/test/java/org/apache/commons/io/FileUtilsTest.java:
##########
@@ -2463,6 +2482,24 @@ public void testReadFileToStringWithEncoding() throws
Exception {
assertEquals("Hello /u1234", data);
}
+ @Test
+ public void testReadFileToString_Errors() {
+ assertThrows(NullPointerException.class, () ->
FileUtils.readFileToString(null));
+ assertThrows(IOException.class, () -> FileUtils.readFileToString(new
File("non-exsistent")));
+ assertThrows(IOException.class, () ->
FileUtils.readFileToString(tempDirFile));
+ assertThrows(IOException.class, () ->
FileUtils.readFileToString(tempDirFile, "unsupported-charset"));
+ }
+
+ @Test
+ @EnabledIf("isPosixFilePermissionsSupported")
+ public void testReadFileToString_IOExceptionOnPosixFileSystem() throws
Exception {
Review Comment:
Hi @chkpnt
I prefer fewer changes in this PR because it is supposed to be about
Javadoc, not code. The use of `@EnabledIf("isPosixFilePermissionsSupported")`
is fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]