Add AdvancedQueryForResultLookupDBIntegrationTest

Made in preparation of #378