why in Unit testing current session is empty?

0
in Unit testing current session is empty by default how can I check a microflow which uses current user?
asked
1 answers
1

Unit tests run in the system context so there isn’t a current user as such.

One way to test microflows that have dependancies such as the current user is to instead pass it as a parameter to a testable submicroflow. In your unit test you create or retrieve a user and pass it to the submicroflow. In your production code, you just pass in the current user.

Hope this helps.

answered