I'm new to Java security, and it's hard for me to figure out how to correctly answer this Google question.
I have a line of code that reads AccessController.getContext() .
I want to run a test where I mock the result. Unfortunately, I have no idea what I'm doing.
How to set the AccessControlContext returned by AccessController.getContext() ?
Update
Just to clarify, I know how to simulate interfaces. AccessController is a Java security feature. I'm having trouble figuring out how to set up my own context so that when I call the AccessController.getContext() method, it will return the AccessControlContext of its choice.
source share