String address = "http://localhost:" + PORT + "/bookstore/books/image";
WebClient client = WebClient.create(address);
HTTPConduit conduit = WebClient.getConfig(client).getHttpConduit();
conduit.getClient().setReceiveTimeout(1000000);
conduit.getClient().setConnectionTimeout(1000000);
client.type("multipart/mixed").accept("multipart/mixed");
InputStream is2 = client.post(is1, InputStream.class);
byte[] image1 = IOUtils.readBytesFromStream(
getClass().getResourceAsStream("/org/apache/cxf/systest/jaxrs/resources/java.jpg"));
byte[] image2 = IOUtils.readBytesFromStream(is2);
assertTrue(Arrays.equals(image1, image2));