@Test
  public void testNoFallbackOnIncorrectConf() throws Exception {

    Configuration conf = new Configuration();

    jsonReportFile = new File(workDir, "json_reporting");
    jsonReportFile.delete();

    conf.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, "local");
    conf.set(MetastoreConf.ConfVars.METRICS_CLASS.getHiveName(), CodahaleMetrics.class.getCanonicalName());
    conf.set(MetastoreConf.ConfVars.HIVE_METRICS_REPORTER.getHiveName(), "JMX, JSON");
    conf.set(MetastoreConf.ConfVars.HIVE_CODAHALE_METRICS_REPORTER_CLASSES.getHiveName(),
        "org.apache.hadoop.hive.common.metrics.NonExistentReporter");
    conf.set(MetastoreConf.ConfVars.METRICS_JSON_FILE_LOCATION.getHiveName(), jsonReportFile.toString());
    conf.setTimeDuration(MetastoreConf.ConfVars.METRICS_JSON_FILE_INTERVAL.getHiveName(), 100,
        TimeUnit.MILLISECONDS);

    try {
      MetricsFactory.init(conf);
    } catch (InvocationTargetException expectedException) {

    }

    Assert.assertFalse(jsonReportFile.exists());
  }
Tests that the deprecated HIVE_METRICS_REPORTER config is not used if
HIVE_CODAHALE_METRICS_REPORTER_CLASSES is present but incorrect.

The deprecated config specifies json reporters whereas the newer one doesn't. Validates that
the JSON file is not created.
standalone-metastore/metastore-common/src/test/java/org/apache/hadoop/hive/common/metrics/metrics2/TestCodahaleReportersConf.java