@Test(expected = InvalidOperationException.class)
  public void testDropDatabaseWithFunction() throws Exception {
    Database database = testDatabases[0];

    Function testFunction =
        new FunctionBuilder()
            .setDbName(database.getName())
            .setName("test_function")
            .setClass("org.apache.hadoop.hive.ql.udf.generic.GenericUDFUpper")
            .create(client, metaStore.getConf());


    client.dropDatabase(database.getName(), true, true, false);
  }
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