currentUser and currentSession are null in unit test microflows using Unit Testing module
Hi, I observed both currentUser and currentSession are null in unit test microflows developed using Unit Testing module. Using executeMicroflowAsUser from Community Commons works only if security is enabled. This will not work for disabled security or Security enabled and app running with Anonymous role. Any suggestions on executing unit tests for disabled security or enable security and run as Anonymous role?
Mohan Reddy Kathireddy
Although I have not tested this, you could investigate if the following setup work: in the the unit test microflow you retrieve the anonymous user from the database and then call the CommunityCommons Java action ExecutureMicroflowAsUser. That microflow returns a string, hopefully with a meaningful result that you can use to check the output of the microflow you executed.