use of com.enonic.xp.page.PageDescriptors in project xp by enonic.
the class ApplicationInfoServiceImplTest method mockPageDescriptors.
private void mockPageDescriptors(final ApplicationKey applicationKey) {
final PageDescriptor pageDescriptor1 = PageDescriptor.create().displayName("Landing page").config(Form.create().build()).regions(RegionDescriptors.create().build()).key(DescriptorKey.from("module:landing-page")).build();
final PageDescriptor pageDescriptor2 = PageDescriptor.create().displayName("Log out").config(Form.create().build()).regions(RegionDescriptors.create().build()).key(DescriptorKey.from("module:logout-page")).build();
final PageDescriptors pageDescriptors = PageDescriptors.from(pageDescriptor1, pageDescriptor2);
Mockito.when(pageDescriptorService.getByApplication(applicationKey)).thenReturn(pageDescriptors);
}
use of com.enonic.xp.page.PageDescriptors in project xp by enonic.
the class PageDescriptorServiceTest method testGetByApplication.
@Test
public void testGetByApplication() throws Exception {
final PageDescriptors result = this.service.getByApplication(ApplicationKey.from("myapp1"));
assertNotNull(result);
assertEquals(1, result.getSize());
}
use of com.enonic.xp.page.PageDescriptors in project xp by enonic.
the class PageDescriptorServiceTest method testGetByApplications.
@Test
public void testGetByApplications() throws Exception {
final PageDescriptors result = this.service.getByApplications(ApplicationKeys.from("myapp1", "myapp2"));
assertNotNull(result);
assertEquals(2, result.getSize());
}
use of com.enonic.xp.page.PageDescriptors in project xp by enonic.
the class ApplicationInfoServiceImplTest method testPages.
@Test
public void testPages() {
mockPageDescriptors(this.applicationKey);
final PageDescriptors pageDescriptors = this.service.getPageDescriptors(this.applicationKey);
assertEquals(pageDescriptors.getSize(), 2);
}
Aggregations