blogService = injector.getInstance(BlogService.class);
}
@Test
public void testCreateOrUpdate() throws Exception {
Blog blog = new Blog();
blog.setName("Just Myblog.");
blog.addUrl("http://jdkcn.com");
assertNull(blog.getId());
String blogId = blogService.saveOrUpdate(blog).getId();
assertNotNull(blogId);
assertNull(blog.getId());
Blog savedBlog = blogService.get(blogId);
assertEquals("Just Myblog.", savedBlog.getName());
}