@Test
  public void testCopySingleEmptyFile() throws IOException {
    String file1Name = "file1.txt";
    Path copySrc = new Path(basePath, "copySrc");
    Path copyDst = new Path(basePath, "copyDst");
    try {
      fs.create(new Path(basePath, new Path(copySrc, file1Name))).close();
      DataCopyStatistics copyStatistics = new DataCopyStatistics();
      Assert.assertTrue("FileUtils.copy failed to copy data",
              FileUtils.copy(fs, copySrc, fs, copyDst, false, false, conf, copyStatistics));

      Path dstFileName1 = new Path(copyDst, file1Name);
      Assert.assertTrue(fs.exists(new Path(copyDst, file1Name)));
      Assert.assertEquals(fs.getFileStatus(dstFileName1).getLen(), 0);
    } finally {
      try {
        fs.delete(copySrc, true);
        fs.delete(copyDst, true);
      } catch (IOException e) {
        // Do nothing
      }
    }
  }
Integration tests for {{@link FileUtils}. Tests run against a {@link HadoopShims.MiniDFSShim}.
itests/hive-unit-hadoop2/src/test/java/org/apache/hadoop/hive/common/TestFileUtils.java