@Override
  protected IMetaStoreClient getClient() throws Exception {

    Configuration svrConf = new Configuration(conf);
    int port = MetaStoreTestUtils.startMetaStoreWithRetry(HadoopThriftAuthBridge.getBridge(),
        svrConf, false, false, false, false, false);
    // Only set the default catalog on the client.
    MetastoreConf.setVar(conf, MetastoreConf.ConfVars.THRIFT_URIS, "thrift://localhost:" + port);
    MetastoreConf.setVar(conf, MetastoreConf.ConfVars.CATALOG_DEFAULT, catName);
    IMetaStoreClient client = new HiveMetaStoreClient(conf);
    assert !client.isLocalMetaStore();
    // Don't make any calls but catalog calls until the catalog has been created, as we just told
    // the client to direct all calls to a catalog that does not yet exist.
    catLocation = MetaStoreTestUtils.getTestWarehouseDir(catName);
    Catalog cat = new CatalogBuilder()
        .setName(catName)
        .setLocation(catLocation)
        .build();
    client.createCatalog(cat);
    return client;
  }
This tests metastore client calls that do not specify a catalog but with the config on the
client set to go to a non-default catalog.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestCatalogNonDefaultClient.java