public void testGetGenericBook() throws Exception {
String baseAddress = "http://localhost:" + PORT + "/the/thebooks8/books";
WebClient wc = WebClient.create(baseAddress);
Long id = wc.type("application/xml").accept("text/plain").post(new Book("CXF", 1L), Long.class);
assertEquals(new Long(1), id);
Book book = wc.accept("application/xml").query("id", 1L).get(Book.class);
assertEquals("CXF", book.getName());
}
@Test
public void testPostGeneratedBook() throws Exception {