@Test(expected = NoSuchObjectException.class)
  public void fetchDatabaseInNonExistentCatalog() throws TException {
    client.getDatabase("nosuch", Warehouse.DEFAULT_DATABASE_NAME);
  }
This test creates and queries a database and then drops it. Good for testing the happy path.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDatabases.java