From Kai in the Box Team Slack:
I’m trying to write an integration test using the execute() syntax to trigger them.
I struggled to pass queryString through to the event under test and all my tests failed when requiring data via the query string.
Was using this syntax:
event.execute( event = “v1:echo.something”, renderResults = true, queryString = “bla=blubb”) and qS will be ignored.
I dug around in BaseTestCase and it turns out that around lines 390-400, the queryString passed into execute is only added to the requestContext if the argument route was passed to execute. So, this:
execute( route = “/api/v1/echo/something”, renderResults = true, queryString = “bla=blubb”) works fine.
Now, is there ANY reason why that would be intended? To me, it seems an arbitrary choice or bug/oversight - but I’m wondering if there’s any other intention and reason why I can’t use query string with event?