@Override
  public Table alterTable(String catName, String dbname, String name, Table newTable, String queryValidWriteIds)
          throws InvalidObjectException, MetaException {
    if (alterTableModifier != null) {
      CallerArguments args = new CallerArguments(dbname);
      args.tblName = name;
      Boolean success = alterTableModifier.apply(args);
      if ((success != null) && !success) {
        throw new MetaException("InjectableBehaviourObjectStore: Invalid alterTable operation on Catalog : " + catName +
                " DB: " + dbname + " table: " + name);
      }
    }
    return super.alterTable(catName, dbname, name, newTable, queryValidWriteIds);
  }
A utility class to pass the arguments of the caller to the stub method.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/InjectableBehaviourObjectStore.java