entryService.saveOrUpdate(entry2);
}
@Test
public void testNotDuplicateName() throws Exception {
Entry entry = new Entry();
entry.setType(Type.ENTRY);
entry.setBlog(blog);
entry.setAuthor(author);
entry.setTitle("Welcome to Myblog 2.0");
entry.setContent("My first post..");
entry.setExcerpt("First");
entry.setName("welcome-to-myblog2");
entry.setCommentStatus(CommentStatus.OPEN);
entry.setStatus(Status.PUBLISH);
entry.setPingStatus(PingStatus.OPEN);
entry.setUpdateDate(new Date());
entry.setPublishDate(new Date());
entryService.saveOrUpdate(entry);
Entry entry2 = new Entry();
entry2.setBlog(createBlog("Another Blog", injector.getInstance(BlogService.class)));
entry2.setType(Type.ENTRY);
entry2.setAuthor(author);
entry2.setTitle("Another Welcome");
entry2.setContent("Another content");
entry2.setExcerpt("First");
entry2.setName("welcome-to-myblog2");
entry2.setCommentStatus(CommentStatus.OPEN);
entry2.setStatus(Status.PUBLISH);
entry2.setPingStatus(PingStatus.OPEN);
entry2.setUpdateDate(new Date());
entry2.setPublishDate(new Date());
entryService.saveOrUpdate(entry2);
}