@Test
  public void testCSVOutputDeprecation() throws Throwable {
    String SCRIPT_TEXT = getFormatTestQuery();
    List<String> argList = getBaseArgs(miniHS2.getBaseJdbcURL());
    argList.add("--outputformat=csv");

    final String EXPECTED_PATTERN = "Format csv is deprecated, please use csv2";
    testScriptFile(SCRIPT_TEXT, argList, OutStream.ERR,
        Collections.singletonList(new Tuple<>(EXPECTED_PATTERN, true)));
  }
Test writing output using CSV deprecated format
Check for deprecation message
itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java