@Test
  public void testCreateDatabaseOwnerName() throws Exception{
    DatabaseBuilder databaseBuilder = new DatabaseBuilder()
        .setCatalogName("hive")
        .setName("dummy")
        .setOwnerName(null);

    Database db = databaseBuilder.create(client, metaStore.getConf());
    Assert.assertNotNull("Owner name should be filled", db.getOwnerName());
  }
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