private Function getNewFunction() throws MetaException {
    return new FunctionBuilder()
            .setName("test_function_2")
            .setClass(TEST_FUNCTION_CLASS)
            .build(metaStore.getConf());
  }
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