@Test
  public void testGetAllDatabases() throws Exception {
    List<String> allDatabases = client.getAllDatabases();
    Assert.assertEquals("All databases size", 5, allDatabases.size());
    for(Database database : testDatabases) {
      Assert.assertTrue("Checking database names", allDatabases.contains(database.getName()));
    }
    Assert.assertTrue("Checnking that default database is returned",
        allDatabases.contains(DEFAULT_DATABASE));

    // Drop one database, see what remains
    client.dropDatabase(testDatabases[1].getName());
    allDatabases = client.getAllDatabases();
    Assert.assertEquals("All databases size", 4, allDatabases.size());
    for(Database database : testDatabases) {
      if (!database.getName().equals(testDatabases[1].getName())) {
        Assert.assertTrue("Checking database names", allDatabases.contains(database.getName()));
      }
    }
    Assert.assertTrue("Checnking that default database is returned",
        allDatabases.contains(DEFAULT_DATABASE));
    Assert.assertFalse("Checking that the deleted database is not returned",
        allDatabases.contains(testDatabases[1].getName()));
  }
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