}
public void testAtomPOSTBlogEntry() throws Exception {
RestClient client = new RestClient();
Resource resource = client.resource(BASE_URI+"/blogs/0/entries");
AtomEntry entry = new AtomEntry();
AtomPerson author = new AtomPerson();
author.setName("Blog Admin");
author.setEmail("winkblogadmin@wink.blog.com");
entry.getAuthors().add(author);
AtomContent content = new AtomContent();
content.setType("String");
content.setValue("This is a new entry in the blog");
entry.setContent(content);
entry.setTitle(new AtomText(("New blog entry")));
ClientResponse uri = resource.accept("application/atom+xml").contentType("application/atom+xml").post(entry);
String location = uri.getHeaders().getFirst("Location");
assertEquals(BASE_URI+"/blogs/0/entries/3", location);
resource = client.resource(location);
AtomEntry postedEntry = resource.accept("application/atom+xml").get(AtomEntry.class);
author = postedEntry.getAuthors().get(0);
assertNotNull(author);
assertEquals("Blog Admin", author.getName());
assertEquals("winkblogadmin@wink.blog.com", author.getEmail());
assertEquals("3", postedEntry.getId());
assertEquals("This is a new entry in the blog", entry.getContent().getValue());
assertEquals("New blog entry", entry.getTitle().getValue());
assertEquals(0, entry.getLinks().size());
resource = client.resource(BASE_URI+"/blogs/0");