assertFalse( fileService.doCanAdminister() );
}
@Test
public void testDoCanAdministerException() throws Exception {
IAuthorizationPolicy authorizationPolicy = mock( IAuthorizationPolicy.class );
doReturn( authorizationPolicy ).when( fileService ).getPolicy();
doThrow( new InternalError() ).when( authorizationPolicy ).isAllowed( RepositoryReadAction.NAME );
doReturn( true ).when( authorizationPolicy ).isAllowed( RepositoryCreateAction.NAME );
doReturn( false ).when( authorizationPolicy ).isAllowed( AdministerSecurityAction.NAME );