use of org.entando.entando.aps.system.services.page.model.PageDto in project entando-core by entando.
the class PageServiceIntegrationTest method testChangeOnlyPosition.
@Test
public void testChangeOnlyPosition() {
PageDto pageToClone = pageService.getPage("pagina_11", "draft");
assertNotNull(pageToClone);
PageRequest pageRequest = this.createRequestFromDto(pageToClone);
pageRequest.setCode("pagina_13");
PageDto addedPage = pageService.addPage(pageRequest);
assertNotNull(addedPage);
assertEquals("pagina_1", addedPage.getParentCode());
assertEquals(3, addedPage.getPosition());
PagePositionRequest pagePosRequest = new PagePositionRequest();
pagePosRequest.setCode("pagina_13");
pagePosRequest.setParentCode("pagina_1");
pagePosRequest.setPosition(1);
addedPage = pageService.movePage("pagina_13", pagePosRequest);
assertNotNull(addedPage);
assertEquals("pagina_1", addedPage.getParentCode());
assertEquals(1, addedPage.getPosition());
pageService.removePage("pagina_13");
}
use of org.entando.entando.aps.system.services.page.model.PageDto in project entando-core by entando.
the class PageServiceIntegrationTest method testUpdatePageStatus.
@Test
public void testUpdatePageStatus() {
PageDto pageToClone = pageService.getPage("pagina_11", "draft");
assertNotNull(pageToClone);
PageRequest pageRequest = this.createRequestFromDto(pageToClone);
pageRequest.setCode("pagina_13");
PageDto addedPage = pageService.addPage(pageRequest);
assertNotNull(addedPage);
assertEquals("pagina_13", addedPage.getCode());
assertEquals("pagina_1", addedPage.getParentCode());
addedPage = pageService.getPage("pagina_13", "draft");
assertEquals("draft", addedPage.getStatus());
PageStatusRequest pageStatusRequest = new PageStatusRequest();
pageStatusRequest.setStatus("published");
PageDto modPage = pageService.updatePageStatus("pagina_13", pageStatusRequest.getStatus());
assertNotNull(modPage);
assertEquals("published", modPage.getStatus());
addedPage = pageService.getPage("pagina_13", "published");
assertNotNull(addedPage);
assertEquals("published", addedPage.getStatus());
pageService.removePage("pagina_13");
}
use of org.entando.entando.aps.system.services.page.model.PageDto in project entando-core by entando.
the class PageControllerTest method createMetadataList.
private List<PageDto> createMetadataList(String json) throws IOException, JsonParseException, JsonMappingException {
ObjectMapper mapper = new ObjectMapper();
List<PageDto> result = mapper.readValue(json, new TypeReference<List<PageDto>>() {
});
return result;
}
Aggregations