Search in sources :

Example 1 with AfterComponent

use of org.xwiki.test.annotation.AfterComponent in project xwiki-platform by xwiki.

the class UserAndGroupDocumentReferenceResolverTest method afterComponent.

@AfterComponent
public void afterComponent() throws Exception {
    EntityReferenceProvider provider = this.mocker.registerMockComponent(EntityReferenceProvider.class);
    when(provider.getDefaultReference(EntityType.WIKI)).thenReturn(new WikiReference("defaultwiki"));
}
Also used : EntityReferenceProvider(org.xwiki.model.reference.EntityReferenceProvider) WikiReference(org.xwiki.model.reference.WikiReference) AfterComponent(org.xwiki.test.annotation.AfterComponent)

Example 2 with AfterComponent

use of org.xwiki.test.annotation.AfterComponent in project xwiki-platform by xwiki.

the class PageTest method configureComponentsBeforeOldcoreRuleForPageTest.

/**
 * Set up of Components after the Components declared in {@link org.xwiki.test.annotation.ComponentList} have been
 * handled but before {@link MockitoOldcoreRule#before(Class)} has been called (i.e. before it has created Mocks
 * and configured Components).
 *
 * @throws Exception in case of errors
 */
@AfterComponent
public void configureComponentsBeforeOldcoreRuleForPageTest() throws Exception {
    // Configure the Execution Context
    ExecutionContext ec = new ExecutionContext();
    mocker.<Execution>getInstance(Execution.class).setContext(ec);
}
Also used : ExecutionContext(org.xwiki.context.ExecutionContext) Execution(org.xwiki.context.Execution) AfterComponent(org.xwiki.test.annotation.AfterComponent)

Example 3 with AfterComponent

use of org.xwiki.test.annotation.AfterComponent in project xwiki-platform by xwiki.

the class CurrentUserAndGroupDocumentReferenceResolverTest method afterComponent.

@AfterComponent
public void afterComponent() throws Exception {
    EntityReferenceProvider provider = this.mocker.registerMockComponent(EntityReferenceProvider.class, "current");
    when(provider.getDefaultReference(EntityType.WIKI)).thenReturn(new WikiReference("currentwiki"));
}
Also used : EntityReferenceProvider(org.xwiki.model.reference.EntityReferenceProvider) WikiReference(org.xwiki.model.reference.WikiReference) AfterComponent(org.xwiki.test.annotation.AfterComponent)

Aggregations

AfterComponent (org.xwiki.test.annotation.AfterComponent)3 EntityReferenceProvider (org.xwiki.model.reference.EntityReferenceProvider)2 WikiReference (org.xwiki.model.reference.WikiReference)2 Execution (org.xwiki.context.Execution)1 ExecutionContext (org.xwiki.context.ExecutionContext)1