garydgregory commented on a change in pull request #131:
URL: https://github.com/apache/commons-io/pull/131#discussion_r462625381



##########
File path: 
src/test/java/org/apache/commons/io/FileUtilsCopyDirectoryToDirectoryTestCase.java
##########
@@ -73,6 +83,48 @@ public void 
copyDirectoryToDirectoryThrowsNullPointerExceptionWithCorrectMessage
         assertExceptionTypeAndMessage(srcDir, destDir, 
NullPointerException.class, "destinationDir");
     }
 
+
+    @Test
+    public void copyFileWrongPermissions() throws IOException {
+        
+        
+        final File destDir = createTemporaryFolderIn(null);
+        final  Path srcFile = Files.createTempFile("tmp-output", ".xml");
+        final Path path = Paths.get(destDir.getAbsolutePath(), "newFile.xml");
+
+        try {
+            FileUtils.copyFile(srcFile.toFile(), path.toFile());
+        } catch (IllegalArgumentException iae) {
+               iae.printStackTrace();
+        }
+        
+        
assertTrue(Files.getPosixFilePermissions(path).contains(PosixFilePermission.OTHERS_READ),
 Files.getPosixFilePermissions(path).toString());

Review comment:
       @cosmoJFH 
   Here you are testing that a target path has a certain attribute but you are 
not checking that this attribute was in fact present in the source.
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to