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);
}
Aggregations