You need to sign in to do that
Don't have an account?
adisun
Testing Auth.SessionManagement.getCurrentSession() fails
Hello
A newbie trying to test an apex which is using the Auth.SessionManagement.getCurrentSession().
When I invoke the method global Process.PluginResult invoke(Process.PluginRequest request)
from my test class using plugin.invoke(request), the test fails with "System.UnexpectedException: Current session unavailable"
Question is: How to test a method which has an internal call to Auth.SessionManagement.getCurrentSession()
I do not find a way to set the session using the API. Any help is appreciated!
Best Answer chosen by adisun
adisun
Used if(!Test.isRunningTest()) to stop that statement being executed! Worked as expected!