What way do you test the microflows?
As microflow should only be accessible by an authorized user, you must be logged in with an user, also when executing automated testing.
Im not really sure why do you need to have a session for executing unit test cases.
But I can also imagine, there could some corner cases which may require.
You could have a java class that could create a session for a user with Mendix Core. Refer the below URL.