@Test
public void testGetBookJsonp() throws Exception {
String url = "http://localhost:" + PORT + "/the/jsonp/books/123";
WebClient client = WebClient.create(url);
client.accept("application/json, application/x-javascript");
client.query("_jsonp", "callback");
WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(1000000L);
Response r = client.get();
assertEquals("application/x+javascript", r.getMetadata().getFirst("Content-Type"));
assertEquals("callback({\"Book\":{\"id\":123,\"name\":\"CXF in Action\"}});",
IOUtils.readStringFromStream((InputStream)r.getEntity()));