@Test
  public void testDefaultDatabaseData() throws Exception {
    Database database = client.getDatabase(DEFAULT_DATABASE);
    Assert.assertEquals("Default database name", "default", database.getName());
    Assert.assertEquals("Default database description", "Default Hive database",
        database.getDescription());
    Assert.assertEquals("Default database location", metaStore.getExternalWarehouseRoot(),
        new Path(database.getLocationUri()));
    Assert.assertEquals("Default database parameters", new HashMap<String, String>(),
        database.getParameters());
    Assert.assertEquals("Default database owner", "public", database.getOwnerName());
    Assert.assertEquals("Default database owner type", PrincipalType.ROLE, database.getOwnerType());
    Assert.assertNull("Default database privileges", database.getPrivileges());
    Assert.assertTrue("database create time should be set", database.isSetCreateTime());
    Assert.assertTrue("Database create time should be non-zero", database.getCreateTime() > 0);
  }
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