Package fr.gouv.vitam.common.shiro.junit
Class AbstractShiroTest
java.lang.Object
fr.gouv.vitam.common.shiro.junit.AbstractShiroTest
Class to use when a test needs a shiro Subject or SecurityManager.
see : https://shiro.apache.org/testing.html
see : https://shiro.apache.org/testing.html
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Clears Shiro's thread state, ensuring the thread remains clean for future test execution.protected static org.apache.shiro.mgt.SecurityManager
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 executingSubject
instance.static void
Clear shiro configuration and dependencies after all tests of the class.
-
Constructor Details
-
AbstractShiroTest
public AbstractShiroTest()Constructor.
-
-
Method Details
-
setSubject
protected void setSubject(org.apache.shiro.subject.Subject subject) Allows subclasses to set the currently executingSubject
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.
-