use of org.xwiki.security.internal.XWikiBridge in project xwiki-platform by xwiki.
the class DefaultAuthorizationManagerIntegrationTest method initializeMocks.
@BeforeComponent
public void initializeMocks() throws Exception {
cache = new TestCache<Object>();
final CacheManager cacheManager = componentManager.registerMockComponent(CacheManager.class);
when(cacheManager.createNewCache(any(CacheConfiguration.class))).thenReturn(cache);
xWikiBridge = componentManager.registerMockComponent(XWikiBridge.class);
userBridge = componentManager.registerMockComponent(UserBridge.class);
securityEntryReader = componentManager.registerMockComponent(SecurityEntryReader.class);
securityCacheRulesInvalidator = componentManager.registerMockComponent(SecurityCacheRulesInvalidator.class);
}
use of org.xwiki.security.internal.XWikiBridge in project xwiki-platform by xwiki.
the class DefaultSecurityCacheLoaderTest method setUp.
@Before
public void setUp() throws Exception {
XWikiBridge bridge = mocker.registerMockComponent(XWikiBridge.class);
when(bridge.getMainWikiReference()).thenReturn(new WikiReference("wiki"));
securityReferenceFactory = mocker.getInstance(SecurityReferenceFactory.class);
mocker.registerMockComponent(SecurityCache.class);
mocker.registerMockComponent(SecurityCacheRulesInvalidator.class);
mocker.registerMockComponent(SecurityEntryReader.class);
mocker.registerMockComponent(UserBridge.class);
mocker.registerMockComponent(AuthorizationSettler.class);
securityCacheLoader = mocker.getInstance(SecurityCacheLoader.class);
}
use of org.xwiki.security.internal.XWikiBridge in project xwiki-platform by xwiki.
the class DefaultSecurityCacheTest method configure.
@Before
public void configure() throws Exception {
if (cache == null) {
cache = new TestCache<Object>();
final CacheManager cacheManager = securityCacheMocker.getInstance(CacheManager.class);
when(cacheManager.createNewCache(any(CacheConfiguration.class))).thenReturn(cache);
}
XWikiBridge xwikiBridge = securityReferenceFactoryMocker.getInstance(XWikiBridge.class);
when(xwikiBridge.getMainWikiReference()).thenReturn(new WikiReference("xwiki"));
this.factory = securityReferenceFactoryMocker.getComponentUnderTest();
this.securityCache = securityCacheMocker.getComponentUnderTest();
aMissingParentRef = factory.newEntityReference(new SpaceReference("space", new WikiReference("missing")));
aMissingEntityRef = factory.newEntityReference(new DocumentReference("missingPage", xspaceRef.getOriginalSpaceReference()));
aMissingUserRef = factory.newUserReference(new DocumentReference("missingUser", xXWikiSpace.getOriginalSpaceReference()));
aMissingGroupRef = factory.newGroupReference(new DocumentReference("missingGroup", xXWikiSpace.getOriginalSpaceReference()));
aMissingWikiRef = factory.newEntityReference(new WikiReference("missingWiki"));
}
use of org.xwiki.security.internal.XWikiBridge in project xwiki-platform by xwiki.
the class SecurityReferenceTest method configure.
@Before
public void configure() throws Exception {
XWikiBridge xwikiBridge = securityReferenceFactoryMocker.getInstance(XWikiBridge.class);
when(xwikiBridge.getMainWikiReference()).thenReturn(new WikiReference("xwiki"));
factory = securityReferenceFactoryMocker.getComponentUnderTest();
}
Aggregations