entry = entryService.saveOrUpdate(entry);
}
@Test
public void testSaveOrUpdate() throws Exception {
Comment comment = new Comment();
comment.setEntry(entry);
comment.setAuthor(author);
comment.setContent("Test comment");
comment.setEmail("tester@gmail.com");
comment.setIp("127.0.0.1");
assertNull(comment.getId());
String commentId = commentService.saveOrUpdate(comment).getId();
assertNotNull(commentId);
Comment savedComment = commentService.get(commentId);
assertEquals("tester@gmail.com", savedComment.getEmail());
}