JCUser user = new JCUser("user1", "mymail@email.mydomain", "qwerty");
JCUser user2 = new JCUser("user2", "mymail2@email.mydomain", "qwerty");
Topic topic = new Topic(user, "my topic");
Post post = new Post(user, "Texty text!");
post.setId(1);
Post post2 = new Post(user2, "Reply to texty text");
post2.setId(3);
topic.addPost(post);
topic.addPost(post2);
model.put("posts", Arrays.asList(post, post2));
MockHttpServletResponse response = new MockHttpServletResponse();
List<Item> result = postListRssViewer.buildFeedItems(model, getMockRequest(), response);
assertEquals(result.get(0).getPubDate(), post.getCreationDate().toDate());
assertEquals(result.get(1).getPubDate(), post2.getCreationDate().toDate());
}