@AfterEach
    void unbind() {
        SecurityUtils.getSubject().logout();
        ThreadContext.unbindSecurityManager();
        ThreadContext.unbindSubject();
        ThreadContext.remove();
    }
Tests @Injecting Subject, Session, Principal and SecurityManager with CDI
integration-tests/jakarta-ee/src/test/java/org/apache/shiro/testing/cdi/ComponentInjectionIT.java