Merge "Fix setting hooks in ApiQueryTest"