List of usage examples for org.apache.shiro UnavailableSecurityManagerException UnavailableSecurityManagerException
public UnavailableSecurityManagerException(String message)
From source file:org.codice.ddf.security.SecurityTest.java
License:Open Source License
@Test public void testRunWithSubjectOrElevateWhenSystemSubjectHasAdminRole() throws Exception { when(SecurityUtils.getSubject()).thenThrow(new UnavailableSecurityManagerException("")); when(systemSubject.execute(callable)).thenReturn("Success!"); configureMocksForBundleContext("server"); String result = Security.runAsAdminWithException(() -> security.runWithSubjectOrElevate(callable)); assertThat(result, is("Success!")); verifyStatic();//from www . j a v a2 s . co m SecurityLogger.auditWarn("Elevating current user permissions to use System subject"); verifyZeroInteractions(shiroSubject); }