assertEquals("http://www.somedomain.com", comment.getWebsite());
assertEquals("http://www.somedomain.com/avatar", comment.getAvatar());
}
public void testProcessAsBlogContributorWhenReplyingToComment() throws Exception {
BlogService service = new BlogService();
BlogEntry blogEntry = new BlogEntry(blog);
service.putBlogEntry(blogEntry);
Comment comment1 = blogEntry.createComment("Title", "Body", "Author", "me@somedomain.com", "http://www.google.com", "http://graph.facebook.com/user/picture", "127.0.0.1");
blogEntry.addComment(comment1);
service.putBlogEntry(blogEntry);
request.setParameter("entry", "" + blogEntry.getId());
request.setParameter("comment", "" + comment1.getId());
request.setParameter("title", "Test Title");
request.setParameter("commentBody", "Test Body");
request.setParameter("author", "Test Author");
request.setParameter("website", "http://www.somedomain.com");
request.setParameter("avatar", "http://www.somedomain.com/avatar");
request.setParameter("submit", "Add Comment");
SecurityUtils.runAsBlogContributor();
View view = action.process(request, response);
assertTrue(view instanceof CommentConfirmationView);
blogEntry = service.getBlogEntry(blog, blogEntry.getId());
assertEquals(2, blogEntry.getComments().size());
Comment comment2 = blogEntry.getComments().get(1);
assertEquals("Test Title", comment2.getTitle());
assertEquals("Test Body", comment2.getBody());