Search in sources :

Example 76 with Site

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);
}
Also used : Site(com.enonic.xp.site.Site) ContentPath(com.enonic.xp.content.ContentPath)

Example 77 with 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);
}
Also used : Site(com.enonic.xp.site.Site) Content(com.enonic.xp.content.Content) ContentId(com.enonic.xp.content.ContentId) ContentPath(com.enonic.xp.content.ContentPath)

Example 78 with Site

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);
}
Also used : Site(com.enonic.xp.site.Site) MacroDescriptorService(com.enonic.xp.macro.MacroDescriptorService) MacroProcessorFactory(com.enonic.xp.portal.macro.MacroProcessorFactory) PortalRequest(com.enonic.xp.portal.PortalRequest) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Site (com.enonic.xp.site.Site)78 Test (org.junit.jupiter.api.Test)51 Content (com.enonic.xp.content.Content)41 PortalRequest (com.enonic.xp.portal.PortalRequest)17 PropertyTree (com.enonic.xp.data.PropertyTree)14 Page (com.enonic.xp.page.Page)12 ContentId (com.enonic.xp.content.ContentId)10 ContentPath (com.enonic.xp.content.ContentPath)10 SiteConfig (com.enonic.xp.site.SiteConfig)10 WebException (com.enonic.xp.web.WebException)10 ApplicationKey (com.enonic.xp.app.ApplicationKey)9 PageTemplate (com.enonic.xp.page.PageTemplate)8 PortalResponse (com.enonic.xp.portal.PortalResponse)7 ControllerMappingDescriptor (com.enonic.xp.site.mapping.ControllerMappingDescriptor)7 SiteDescriptor (com.enonic.xp.site.SiteDescriptor)6 BeforeEach (org.junit.jupiter.api.BeforeEach)6 DescriptorKey (com.enonic.xp.page.DescriptorKey)5 SiteConfigs (com.enonic.xp.site.SiteConfigs)5 Branch (com.enonic.xp.branch.Branch)4 ContentService (com.enonic.xp.content.ContentService)4