@Test(expected = InvalidObjectException.class)
  public void testCreateDatabaseEmptyName() throws Exception {
    Database database = testDatabases[0];

    // Empty new database name
    database.setName("");
    client.createDatabase(database);
    // Throwing InvalidObjectException would be more appropriate, but we do not change the API
  }
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