@Test public void testPostBookProcessingException() throws Exception {
String address="http://localhost:" + PORT + "/bookstore/";
List providers=new ArrayList();
providers.add(new FaultyBookWriter());
WebClient wc=WebClient.create(address,providers);
Future future=wc.async().post(Entity.xml(new Book()),Book.class);
try {
future.get();
fail("Exception expected");
}
catch ( ExecutionException ex) {
assertTrue(ex.getCause() instanceof ProcessingException);
}
wc.close();
}