@Test
  public void testAlterDatabase() throws Exception {
    Database originalDatabase = testDatabases[0];
    Database newDatabase =
        new DatabaseBuilder()
            // The database name is not changed during alter
            .setName(originalDatabase.getName())
            .setOwnerType(PrincipalType.GROUP)
            .setOwnerName("owner2")
            .setLocation(metaStore.getExternalWarehouseRoot() + "/database_location_2")
            .setDescription("dummy description 2")
            .addParam("param_key_1", "param_value_1_2")
            .addParam("param_key_2_3", "param_value_2_3")
            .setCreateTime(originalDatabase.getCreateTime())
            .build(metaStore.getConf());

    client.alterDatabase(originalDatabase.getName(), newDatabase);
    Database alteredDatabase = client.getDatabase(newDatabase.getName());
    Assert.assertEquals("Comparing Databases", newDatabase, alteredDatabase);
  }
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