public void testFileUpload() throws Throwable {
ClientRequest cr = ropClient.buildClientRequest();
UploadUserPhotoRequest request = new UploadUserPhotoRequest();
ClassPathResource resource = new ClassPathResource("photo.png");
UploadFile uploadFile = new UploadFile(resource.getFile());
request.setPhoto(uploadFile);
request.setUserId("1");
ropClient.setMessageFormat(MessageFormat.xml);
CompositeResponse response = ropClient.buildClientRequest()
.post(request, UploadUserPhotoResponse.class, "user.upload.photo", "1.0");
assertNotNull(response);
assertTrue(response.isSuccessful());
assertTrue(response.getSuccessResponse() instanceof UploadUserPhotoResponse);
assertEquals(((UploadUserPhotoResponse) response.getSuccessResponse()).getFileType(), "png");
assertEquals(((UploadUserPhotoResponse) response.getSuccessResponse()).getLength(), uploadFile.getContent().length);
}