Examples of PrivateMessageDto


Examples of org.jtalks.jcommune.web.dto.PrivateMessageDto

     * @throws NotFoundException when message not found
     */
    @RequestMapping(value = "/reply/{pmId}", method = RequestMethod.GET)
    public ModelAndView replyPage(@PathVariable(PM_ID) Long id) throws NotFoundException {
        PrivateMessage pm = pmService.get(id);
        PrivateMessageDto object = PrivateMessageDto.getReplyDtoFor(pm);
        return new ModelAndView(PM_FORM).addObject(DTO, object);
    }
View Full Code Here

Examples of org.jtalks.jcommune.web.dto.PrivateMessageDto

     * @throws NotFoundException when message not found
     */
    @RequestMapping(value = "/quote/{pmId}", method = RequestMethod.GET)
    public ModelAndView quotePage(@PathVariable(PM_ID) Long id) throws NotFoundException {
        PrivateMessage pm = pmService.get(id);
        PrivateMessageDto dto = PrivateMessageDto.getReplyDtoFor(pm);
        dto.setBody(bbCodeService.quote(pm.getBody(), pm.getUserFrom()));
        return new ModelAndView(PM_FORM).addObject(DTO, dto);
    }
View Full Code Here

Examples of org.jtalks.jcommune.web.dto.PrivateMessageDto

    }

    @Test
    public void testGetRegularPmDto() throws Exception {
        //invoke the object under test
        PrivateMessageDto dto = PrivateMessageDto.getFullPmDtoFor(pm);

        //check result
        assertEquals(dto.getBody(), BODY);
        assertEquals(dto.getId(), ID);
        assertEquals(dto.getRecipient(), user.getUsername());
        assertEquals(dto.getTitle(), TITLE);

    }
View Full Code Here

Examples of org.jtalks.jcommune.web.dto.PrivateMessageDto

        @Test
    public void testGetRegularPmDtoNullUser() throws Exception {
        //invoke the object under test
            pm.setUserTo(null);
        PrivateMessageDto dto = PrivateMessageDto.getFullPmDtoFor(pm);

        //check result
        assertEquals(dto.getBody(), BODY);
        assertEquals(dto.getId(), ID);
        assertEquals(dto.getRecipient(), null);
        assertEquals(dto.getTitle(), TITLE);

    }
View Full Code Here

Examples of org.jtalks.jcommune.web.dto.PrivateMessageDto

    }

    @Test
    public void testGetReplyDto() throws Exception {
        //invoke the object under test
        PrivateMessageDto dto = PrivateMessageDto.getReplyDtoFor(pm);

        //check result
        assertEquals(dto.getRecipient(), user.getUsername());
        assertEquals(dto.getTitle(), "Re: " + TITLE);
    }
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.