@Test
  public void testMetaApiAllowed() throws Exception {
    TestAuthValidator.allowActions = true;

    Connection hs2Conn = getConnection("user1");
    DatabaseMetaData dbmetadata = hs2Conn.getMetaData();
    ResultSet res;

    res = dbmetadata.getCatalogs();
    assertFalse(res.next());

    res = dbmetadata.getSchemas();
    assertTrue(res.next());
    assertTrue(res.next());

    res = dbmetadata.getTypeInfo();
    assertTrue(res.next());

    res = dbmetadata.getTables(null, "default", "t%", null);
    assertTrue(res.next());

    res = dbmetadata.getTableTypes();
    assertTrue(res.next());

    res = dbmetadata.getColumns(null, "default", "nosuchtable", null);
    assertFalse(res.next());

    res = dbmetadata.getFunctions(null, null, "trim");
    assertTrue(res.next());

  }
Call the HS2 metadata api's with authorizer allowing those calls
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/jdbc/authorization/TestJdbcMetadataApiAuth.java