@Test
  public void testSelectiveHdfsPatternMaskOnlyHdfsPath() {
    Assert.assertEquals("nothing to be masked", processLine("nothing to be masked"));
    Assert.assertEquals("hdfs://", processLine("hdfs://"));
    Assert.assertEquals(String.format("hdfs://%s", QOutProcessor.HDFS_MASK),
        processLine("hdfs:///"));
    Assert.assertEquals(String.format("hdfs://%s", QOutProcessor.HDFS_MASK),
        processLine("hdfs://a"));
    Assert.assertEquals(String.format("hdfs://%s other text", QOutProcessor.HDFS_MASK),
        processLine("hdfs://tmp.dfs.com:50029/tmp other text"));
    Assert.assertEquals(String.format("hdfs://%s", QOutProcessor.HDFS_MASK), processLine(
        "hdfs://localhost:51594/build/ql/test/data/warehouse/default/encrypted_table_dp/p=2014-09-23"));

    Assert.assertEquals(String.format("hdfs://%s", QOutProcessor.HDFS_MASK),
        processLine("hdfs://localhost:11111/tmp/ct_noperm_loc_foo1"));

    Assert.assertEquals(
        String.format("hdfs://%s hdfs://%s", QOutProcessor.HDFS_MASK, QOutProcessor.HDFS_MASK),
        processLine("hdfs://one hdfs://two"));

    Assert.assertEquals(
        String.format(
            "some text before [name=hdfs://%s]] some text between hdfs://%s some text after",
            QOutProcessor.HDFS_MASK, QOutProcessor.HDFS_MASK),
        processLine(
            "some text before [name=hdfs://localhost:11111/tmp/ct_noperm_loc_foo1]] some text between hdfs://localhost:22222/tmp/ct_noperm_loc_foo2 some text after"));

    Assert.assertEquals(
        String.format("-rw-r--r--   3 %s %s       %s %s hdfs://%s", QOutProcessor.HDFS_USER_MASK,
            QOutProcessor.HDFS_GROUP_MASK, QOutProcessor.HDFS_SIZE_MASK , QOutProcessor.HDFS_DATE_MASK, QOutProcessor.HDFS_MASK),
        processLine(
            "-rw-r--r--   3 hiveptest supergroup       2557 2018-01-11 17:09 hdfs://hello_hdfs_path"));

    Assert.assertEquals(
        String.format("-rw-r--r--   3 %s %s       %s %s hdfs://%s", QOutProcessor.HDFS_USER_MASK,
            QOutProcessor.HDFS_GROUP_MASK, QOutProcessor.HDFS_SIZE_MASK, QOutProcessor.HDFS_DATE_MASK, QOutProcessor.HDFS_MASK),
        processLine(
            "-rw-r--r--   3 hiveptest supergroup       2557 2018-01-11 17:09 hdfs://hello_hdfs_path"));
    // Test Hdfs Size not to be masked when its 0.
    Assert.assertEquals(
            String.format("-rw-r--r--   3 %s %s       0 %s hdfs://%s", QOutProcessor.HDFS_USER_MASK,
                    QOutProcessor.HDFS_GROUP_MASK, QOutProcessor.HDFS_DATE_MASK, QOutProcessor.HDFS_MASK),
            processLine(
                    "-rw-r--r--   3 hiveptest supergroup       0 2018-01-11 17:09 hdfs://hello_hdfs_path"));
  }
This class contains unit tests for QTestUtil
itests/util/src/test/java/org/apache/hadoop/hive/ql/TestQOutProcessor.java