Examples of PostDTO


Examples of com.bolbachchan.blog.dto.PostDTO

     * {@link com.bolbachchan.blog.dao.posts.UserPostsDAOImpl#saveNewPost(com.bolbachchan.blog.dto.PostDTO)}
     * .
     */
    @Test
    public void testSaveNewPost() {
  PostDTO dto = new PostDTO();
  UserDetails user = new UserDetails();
  user.setObjId(1);

  dto.setUserDetails(user);
  dto.setPostTitle("Junit");
  dto.setPostContent("This is a JUnit test case");

  dao.saveNewPost(dto);
    }
View Full Code Here

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

        //invoke the object under test
        ModelAndView actualMav = controller.editPage(POST_ID);
        //check result
        this.assertEditPostFormMavIsCorrect(actualMav);

        PostDto dto = assertAndReturnModelAttributeOfType(actualMav, "postDto", PostDto.class);
        assertEquals(dto.getId(), TOPIC_ID);

        assertModelAttributeAvailable(actualMav, "breadcrumbList");
    }
View Full Code Here

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

        assertModelAttributeAvailable(actualMav, "breadcrumbList");
    }

    @Test
    public void testUpdatePost() throws NotFoundException {
        PostDto dto = getDto();
        BindingResult bindingResult = new BeanPropertyBindingResult(dto, "postDto");
        ModelAndView mav = controller.update(dto, bindingResult, POST_ID);
        assertViewName(mav, "redirect:/posts/" + dto.getId());
        verify(postService).updatePost(Matchers.<Post>any(), anyString());
    }
View Full Code Here

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

        verify(postService).updatePost(Matchers.<Post>any(), anyString());
    }

    @Test
    public void updateWithError() throws NotFoundException {
        PostDto dto = this.getDto();
        BeanPropertyBindingResult resultWithErrors = mock(BeanPropertyBindingResult.class);

        when(resultWithErrors.hasErrors()).thenReturn(true);

        ModelAndView mav = controller.update(dto, resultWithErrors, POST_ID);
View Full Code Here

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

    private void assertAnswerMavIsCorrect(ModelAndView mav) {
        assertViewName(mav, "topic/answer");
        assertAndReturnModelAttributeOfType(mav, "topic", Topic.class);
        long topicId = assertAndReturnModelAttributeOfType(mav, "topicId", Long.class);
        assertEquals(topicId, TOPIC_ID);
        PostDto dto = assertAndReturnModelAttributeOfType(mav, "postDto", PostDto.class);
        assertEquals(dto.getId(), 0);
        assertModelAttributeAvailable(mav, "breadcrumbList");
    }
View Full Code Here

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

        assertEquals(topicId, TOPIC_ID);
        assertEquals(postId, POST_ID);
    }

    private PostDto getDto() {
        PostDto dto = new PostDto();
        dto.setId(POST_ID);
        dto.setBodyText(POST_CONTENT);
        dto.setTopicId(TOPIC_ID);
        return dto;
    }
View Full Code Here

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

        return new ModelAndView("topic/postList")
                .addObject("viewList", locationService.getUsersViewing(topic))
                .addObject("usersOnline", sessionRegistry.getAllPrincipals())
                .addObject("postsPage", postsPage)
                .addObject("topic", topic)
                .addObject(POST_DTO, new PostDto())
                .addObject("subscribed", topic.getSubscribers().contains(currentUser))
                .addObject(BREADCRUMB_LIST, breadcrumbBuilder.getForumBreadcrumb(topic));
    }
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.