@Test
  public void testCreateFunctionDefaultValues() throws Exception {
    Function function = new Function();
    function.setDbName(OTHER_DATABASE);
    function.setFunctionName("test_function");
    function.setClassName(TEST_FUNCTION_CLASS);
    function.setOwnerName("owner3");
    function.setOwnerType(PrincipalType.USER);
    function.setFunctionType(FunctionType.JAVA);

    client.createFunction(function);

    Function createdFunction = client.getFunction(function.getDbName(),
        function.getFunctionName());
    Assert.assertEquals("Comparing OwnerName", createdFunction.getOwnerName(), "owner3");
    Assert.assertEquals("Comparing ResourceUris", 0, createdFunction.getResourceUris().size());
    // The create time is set
    Assert.assertNotEquals("Comparing CreateTime", 0, createdFunction.getCreateTime());
  }
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