@Test
  public void testCreate() throws SemanticException, IOException {
    HiveConf conf = new HiveConf();
    Mockito.when(outputFile.getFileSystem(conf)).thenReturn(fileSystem);
    Mockito.when(fileSystem.create(outputFile)).thenReturn(outputStream);
    Utils.create(outputFile, conf);
    Mockito.verify(outputStream, times(1)).close();
  }
Test class to test dump utils.
ql/src/test/org/apache/hadoop/hive/ql/exec/repl/dump/TestUtils.java