{
log.info("starting testInterceptors()");
// Create book.
ClientRequest request = new ClientRequest("http://localhost:8080/resteasy-cdi-ejb-test/rest/create/");
Book book = new Book("RESTEasy: the Sequel");
Type genericType = (new GenericType<Book>() {}).getGenericType();
request.body(Constants.MEDIA_TYPE_TEST_XML_TYPE, book, genericType);
ClientResponse<?> response = request.post();
log.info("Status: " + response.getStatus());
assertEquals(200, response.getStatus());
int id = response.getEntity(int.class);
log.info("id: " + id);
Assert.assertEquals(0, id);
// Retrieve book.
request = new ClientRequest("http://localhost:8080/resteasy-cdi-ejb-test/rest/book/" + id);
request.accept(Constants.MEDIA_TYPE_TEST_XML);
response = request.get();
log.info("Status: " + response.getStatus());
assertEquals(200, response.getStatus());
Book result = response.getEntity(Book.class);
log.info("book: " + book);
Assert.assertEquals(book, result);
request = new ClientRequest("http://localhost:8080/resteasy-cdi-ejb-test/rest/test/");
response = request.post();