assertTrue(view instanceof RedirectView);
}
public void testPublishBlogEntryAsIsAndCheckCommentsStaysIndexed() throws Exception {
blog.getPluginProperties().setProperty(IpAddressListener.WHITELIST_KEY, "127.0.0.1");
BlogService service = new BlogService();
BlogEntry blogEntry = new BlogEntry(blog);
blogEntry.setDate(new Date(100000));
blogEntry.setPublished(false);
service.putBlogEntry(blogEntry);
Comment comment = blogEntry.createComment("title", "body", "author", "email", "website", "avatar", "127.0.0.1");
blogEntry.addComment(comment);
service.putBlogEntry(blogEntry);
String commentId = comment.getGuid();
assertTrue(blog.getResponseIndex().getApprovedResponses().contains(commentId));
// now execute the action
request.setParameter("entry", blogEntry.getId());
request.setParameter("publishDate", "as-is");
request.setParameter("submit", "Publish");
View view = action.process(request, response);
blogEntry = service.getBlogEntry(blog, blogEntry.getId());
assertTrue(blogEntry.isPublished());
assertEquals(new Date(100000), blogEntry.getDate());
// check that the original comment remains intact
assertTrue(blog.getResponseIndex().getApprovedResponses().contains(commentId));