use of com.enonic.xp.site.Site in project xp by enonic.
the class RenderBaseHandlerTest method setupContentWithoutPage.
protected final void setupContentWithoutPage() {
when(this.contentService.getByPath(ContentPath.from("site/somepath/content").asAbsolute())).thenReturn(createPage("id", "site/somepath/content", "myapplication:ctype", false));
final Site site = createSite("id", "site");
when(this.contentService.findNearestSiteByPath(isA(ContentPath.class))).thenReturn(site);
}
use of com.enonic.xp.site.Site in project xp by enonic.
the class ServiceHandlerTest method setupContentAndSite.
private void setupContentAndSite() throws Exception {
final Content content = createPage("id", "site/somepath/content", "myapplication:ctype", true);
Mockito.when(this.contentService.getByPath(ContentPath.from("site/somepath/content").asAbsolute())).thenReturn(content);
final Site site = createSite("id", "site", "myapplication:contenttypename");
Mockito.when(this.contentService.getNearestSite(Mockito.isA(ContentId.class))).thenReturn(site);
Mockito.when(this.contentService.findNearestSiteByPath(Mockito.isA(ContentPath.class))).thenReturn(site);
Mockito.when(this.contentService.getById(content.getId())).thenReturn(content);
}
use of com.enonic.xp.site.Site in project xp by enonic.
the class MacroInstructionTest method setUp.
@BeforeEach
public void setUp() {
macroDescriptorService = Mockito.mock(MacroDescriptorService.class);
macroProcessorFactory = Mockito.mock(MacroProcessorFactory.class);
macroInstruction = new MacroInstruction();
macroInstruction.setMacroDescriptorService(macroDescriptorService);
macroInstruction.setMacroProcessorFactory(macroProcessorFactory);
portalRequest = new PortalRequest();
Site site = createSite("site-id", "site-name", "myapplication:content-type");
portalRequest.setSite(site);
portalRequest.setContent(site);
}
Aggregations