@Test(expected = InvalidObjectException.class)
  public void createDatabaseInNonExistentCatalog() throws TException {
    Database db = new DatabaseBuilder()
        .setName("doomed")
        .setCatalogName("nosuch")
        .create(client, metaStore.getConf());
  }
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