Examples of SimplePage


Examples of org.jtalks.jcommune.model.entity.SimplePage

        verify(dao).isExist(ID);
    }

    @Test
    void testGetPageByPathName() throws NotFoundException {
        SimplePage samplePage = new SimplePage(NAME, CONTENT, PATH_NAME);
        when(dao.getPageByPathName(PATH_NAME)).thenReturn(samplePage);

        SimplePage actualSimplePage = simplePageService.getPageByPathName(PATH_NAME);

        assertNotNull(actualSimplePage);

        verify(dao).getPageByPathName(PATH_NAME);
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.SimplePage

        verify(dao).getPageByPathName(PATH_NAME);
    }

    @Test
    void testCreatePage() throws EntityExistsException {
        SimplePage simplePage = new SimplePage(NAME, CONTENT, PATH_NAME);
        JCUser user = new JCUser("username", "email", "password");

        when(dao.isExist(PATH_NAME)).thenReturn(false);
        when(groupDao.getGroupByName(AdministrationGroup.ADMIN.getName())).thenReturn(new Group());

        SimplePage actualSimplePage = simplePageService.createPage(simplePage, user);

        assertEquals(actualSimplePage.getName(), NAME);
        assertEquals(actualSimplePage.getContent(), CONTENT);
        assertEquals(actualSimplePage.getPathName(), PATH_NAME);

        verify(dao).isExist(PATH_NAME);
        verify(dao).saveOrUpdate(simplePage);
        verify(aclBuilder).grant(GeneralPermission.WRITE);
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.SimplePage

    @Test(expectedExceptions = {NotFoundException.class})
    void testGetPageByPathNameFailPageNotFound() throws NotFoundException {

        when(dao.getPageByPathName(PATH_NAME)).thenReturn(null);

        SimplePage actualSimplePage = simplePageService.getPageByPathName(PATH_NAME);
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.SimplePage

    }

    @Test(expectedExceptions = {EntityExistsException.class})
    void testCreatePageFailPageAlreadyExists() throws EntityExistsException {

        SimplePage simplePage = new SimplePage(NAME, CONTENT, PATH_NAME);
        JCUser user = new JCUser("username", "email", "password");

        when(dao.isExist(PATH_NAME)).thenReturn(true);
        SimplePage actualSimpePage = simplePageService.createPage(simplePage, user);
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.SimplePage

     */
    @Override
    @PreAuthorize("hasPermission(#simplePageInfoContainer.getId(), 'USER', 'ProfilePermission.CREATE_FORUM_FAQ')")
    public void updatePage(SimplePageInfoContainer simplePageInfoContainer) throws NotFoundException {

        SimplePage simplePage = get(simplePageInfoContainer.getId());
        if (simplePage == null) {
            String message = "Simple page with id = " + simplePageInfoContainer.getId() + " not found.";
            logger.info(message);
            throw new NotFoundException(message);
        }

        simplePage.setName(simplePageInfoContainer.getName());
        simplePage.setContent(simplePageInfoContainer.getContent());

        this.getDao().saveOrUpdate(simplePage);

        logger.info("Simple page with id = " + simplePage.getId() + " update.");
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.SimplePage

    /**
     * {@inheritDoc}
     */
    @Override
    public SimplePage getPageByPathName(String pathName) throws NotFoundException {
        SimplePage simplePage = this.getDao().getPageByPathName(pathName);
        if (simplePage == null) {
            String msg = "SimplePage " + pathName + " not found.";
            logger.info(msg);
            throw new NotFoundException(msg);

View Full Code Here

Examples of org.jtalks.jcommune.model.entity.SimplePage

        when(userService.getCurrentUser()).thenReturn(currentUser);
    }

    @Test
    public void showPageTest() throws NotFoundException {
        SimplePage simplePage = new SimplePage(NAME, CONTENT, PATH_NAME);

        //set expectations
        when(simplePageService.getPageByPathName(PATH_NAME)).thenReturn(simplePage);

        //invoke the object under test
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.SimplePage

        assertEqualsSimplePageAndSimplePageDto(actualSimplePage, simplePage);
    }

    @Test
    public void showEditPageTest() throws NotFoundException {
        SimplePage simplePage = new SimplePage(NAME, CONTENT, PATH_NAME);

        //set expectations
        when(simplePageService.getPageByPathName(PATH_NAME)).thenReturn(simplePage);
       
View Full Code Here

Examples of org.strecks.controller.impl.SimplePage

  }

  @NavigateForward
  public Page nextPage()
  {
    return new SimplePage();
  }
View Full Code Here

Examples of org.strecks.controller.impl.SimplePage

{

  @NavigateForward
  public Page nextPage1()
  {
    return new SimplePage();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.