1. 程式人生 > >springboot 測試類,項目使用shiro時報錯UnavailableSecurityManagerException

springboot 測試類,項目使用shiro時報錯UnavailableSecurityManagerException

exception adc 項目 available oot ets uri cep setup

大概的問題就是,正常運行項目是沒有問題的

使用測試類是,加載不了shiro的securityManager,主要導致不是很清楚,望告知,

解決方法

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

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

  

springboot 測試類,項目使用shiro時報錯UnavailableSecurityManagerException