@Test
  public void testUrlHook() throws Exception {
    Configuration conf = MetastoreConf.newMetastoreConf();
    MetastoreConf.setVar(conf, ConfVars.CONNECT_URL_HOOK, DummyJdoConnectionUrlHook.class.getName());
    MetastoreConf.setVar(conf, ConfVars.CONNECT_URL_KEY, DummyJdoConnectionUrlHook.initialUrl);
    MetastoreConf.setVar(conf, ConfVars.RAW_STORE_IMPL, DummyRawStoreForJdoConnection.class.getName());
    MetaStoreTestUtils.setConfForStandloneMode(conf);

    // Instantiating the HMSHandler with hive.metastore.checkForDefaultDb will cause it to
    // initialize an instance of the DummyRawStoreForJdoConnection
    HMSHandler hms = new HMSHandler("test_metastore_connection_url_hook_hms_handler", conf);
    hms.init();
  }
TestMetaStoreConnectionUrlHook
Verifies that when an instance of an implementation of RawStore is initialized, the connection
URL has already been updated by any metastore connect URL hooks.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestMetaStoreConnectionUrlHook.java