@Test(expected = MetaException.class)
  public void testAlterFunctionNullDatabaseNameInNew() throws Exception {
    Function newFunction = getNewFunction();
    newFunction.setDbName(null);
    client.alterFunction(DEFAULT_DATABASE, "test_function_to_find_2", newFunction);
  }
This test creates and queries a function and then drops it. Good for testing the happy path.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestFunctions.java