Class AbstractShiroTest


  • public abstract class AbstractShiroTest
    extends java.lang.Object
    Class to use when a test needs a shiro Subject or SecurityManager.
    see : https://shiro.apache.org/testing.html
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractShiroTest()
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void clearSubject()
      Clears Shiro's thread state, ensuring the thread remains clean for future test execution.
      protected static org.apache.shiro.mgt.SecurityManager getSecurityManager()  
      protected static void setSecurityManager​(org.apache.shiro.mgt.SecurityManager securityManager)  
      protected void setSubject​(org.apache.shiro.subject.Subject subject)
      Allows subclasses to set the currently executing Subject instance.
      static void tearDownShiro()
      Clear shiro configuration and dependencies after all tests of the class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractShiroTest

        public AbstractShiroTest()
        Constructor.
    • Method Detail

      • setSubject

        protected void setSubject​(org.apache.shiro.subject.Subject subject)
        Allows subclasses to set the currently executing Subject instance.
        Parameters:
        subject - the Subject instance
      • clearSubject

        protected void clearSubject()
        Clears Shiro's thread state, ensuring the thread remains clean for future test execution.
      • setSecurityManager

        protected static void setSecurityManager​(org.apache.shiro.mgt.SecurityManager securityManager)
      • getSecurityManager

        protected static org.apache.shiro.mgt.SecurityManager getSecurityManager()
      • tearDownShiro

        public static void tearDownShiro()
        Clear shiro configuration and dependencies after all tests of the class.