Question
SIS Consulting
BR
Last activity: 13 Dec 2023 9:30 EST
How to create a Unit Test Case for Dependent Role in When Rule?
I have created a When rule that has an expression using the @HaveRole function to verify that a user has a specific Role Name, so he can access a menu option.
Now, to create a test case for this is where I am facing some difficulties. To test the case, I need to understand how the method haveRole from interface PRAuthorization is retrieving the role from the list of dependent roles in the current role I am using. As, for me to write the text, I'll need to setup the correct context for the case to run and I couldn't find any mention to the dependent role in the clipboard so I could set the user correctly.
Can you direct me to the best approach for this?