org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code
问题 i have a junit test case that runs a code like: if (SecurityUtil.isAuthenticated()) { } and it gives an exception: org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an invalid application configuration. My Test Class configuration is as follows: @RunWith(SpringJUnit4ClassRunner.class) @TestExecutionListeners({ WebContextTestExecutionListener.class