springboot 测试类,项目使用shiro时报错UnavailableSecurityManagerException

大概的问题就是,正常运行项目是没有问题的

使用测试类是,加载不了shiro的securityManager,主要导致不是很清楚,望告知,

解决方法

    @Resource
    org.apache.shiro.mgt.SecurityManager securityManager;

    @Before
    public void setUp() throws Exception {
        ThreadContext.bind(securityManager);
        SecurityUtils.getSubject();
    }

  

猜你喜欢

转载自www.cnblogs.com/skyLogin/p/9265114.html