Search in sources :

Example 1 with WikiCreator

use of org.xwiki.platform.wiki.creationjob.WikiCreator in project xwiki-platform by xwiki.

the class WikiCreationJobScriptServicesTest method setUp.

@Before
public void setUp() throws Exception {
    wikiCreator = mocker.getInstance(WikiCreator.class);
    execution = mocker.getInstance(Execution.class);
    authorizationManager = mocker.getInstance(AuthorizationManager.class);
    wikiDescriptorManager = mocker.getInstance(WikiDescriptorManager.class);
    distributionManager = mocker.getInstance(DistributionManager.class);
    xcontextProvider = mocker.registerMockComponent(XWikiContext.TYPE_PROVIDER);
    xcontext = mock(XWikiContext.class);
    when(xcontextProvider.get()).thenReturn(xcontext);
    xwiki = mock(XWiki.class);
    when(xcontext.getWiki()).thenReturn(xwiki);
    when(wikiDescriptorManager.getMainWikiId()).thenReturn("mainWikiId");
    ExecutionContext executionContext = new ExecutionContext();
    when(execution.getContext()).thenReturn(executionContext);
    ExtensionId extensionId = new ExtensionId("authorized-extension", "1.0");
    when(distributionManager.getWikiUIExtensionId()).thenReturn(extensionId);
}
Also used : Execution(org.xwiki.context.Execution) ExecutionContext(org.xwiki.context.ExecutionContext) WikiDescriptorManager(org.xwiki.wiki.descriptor.WikiDescriptorManager) WikiCreator(org.xwiki.platform.wiki.creationjob.WikiCreator) XWikiContext(com.xpn.xwiki.XWikiContext) XWiki(com.xpn.xwiki.XWiki) ExtensionId(org.xwiki.extension.ExtensionId) AuthorizationManager(org.xwiki.security.authorization.AuthorizationManager) DistributionManager(org.xwiki.extension.distribution.internal.DistributionManager) Before(org.junit.Before)

Aggregations

XWiki (com.xpn.xwiki.XWiki)1 XWikiContext (com.xpn.xwiki.XWikiContext)1 Before (org.junit.Before)1 Execution (org.xwiki.context.Execution)1 ExecutionContext (org.xwiki.context.ExecutionContext)1 ExtensionId (org.xwiki.extension.ExtensionId)1 DistributionManager (org.xwiki.extension.distribution.internal.DistributionManager)1 WikiCreator (org.xwiki.platform.wiki.creationjob.WikiCreator)1 AuthorizationManager (org.xwiki.security.authorization.AuthorizationManager)1 WikiDescriptorManager (org.xwiki.wiki.descriptor.WikiDescriptorManager)1