@Test
  public void testAlterDatabaseCaseInsensitive() throws Exception {
    Database originalDatabase = testDatabases[0];
    Database newDatabase = originalDatabase.deepCopy();
    newDatabase.setDescription("Altered database");

    // Test in upper case
    client.alterDatabase(originalDatabase.getName().toUpperCase(), newDatabase);
    Database alteredDatabase = client.getDatabase(newDatabase.getName());
    Assert.assertEquals("Comparing databases", newDatabase, alteredDatabase);

    // Test in mixed case
    originalDatabase = testDatabases[2];
    newDatabase = originalDatabase.deepCopy();
    newDatabase.setDescription("Altered database 2");
    client.alterDatabase("TeST_daTAbaSe_TO_FiNd_2", newDatabase);
    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