
Originally Posted by
klr8
What you need to understand is that testing an action in isolation is different from testing an entire flow.
If you want to test the action in isolation, just configure it with the necessary mock dependencies and call it inside a unit test passing in a MockRequestContext where you setup the necessary data in all of the available scopes. Then verify if the action does what it needs to do.
If you're testing an entire flow (e.g. in an AbstractFlowExecutionTests subclass), it's the responsability of the flow itself to prepare the necessary data in all of the available scopes, just like in a real life scenario. In this case you're testing the entire flow from a 'external client' point of view, so you need the pass in an ExternalContext with the necessary request parameters, just like would happen when the flow is running in a real webapp.
Erwin