@Test
  public void testCreateDatabaseDefaultValues() throws Exception {
    Database database = new DatabaseBuilder()
        .setName("dummy")
        .create(client, metaStore.getConf());

    Database createdDatabase = client.getDatabase(database.getName());

    Assert.assertNull("Comparing description", createdDatabase.getDescription());
    Assert.assertEquals("Comparing location", metaStore.getExternalWarehouseRoot() + "/" +
                                                  createdDatabase.getName() + ".db", createdDatabase.getLocationUri());
    Assert.assertEquals("Comparing parameters", new HashMap<String, String>(),
        createdDatabase.getParameters());
    Assert.assertNull("Comparing privileges", createdDatabase.getPrivileges());
    Assert.assertEquals("Comparing owner name", SecurityUtils.getUser(),
        createdDatabase.getOwnerName());
    Assert.assertEquals("Comparing owner type", PrincipalType.USER, createdDatabase.getOwnerType());
  }
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