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

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

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

解决方法

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

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

  

posted @ 2018-07-04 20:11  sky丶尕少  阅读(383)  评论(0编辑  收藏  举报