fakeTransport.contentLengthNotSpecified = true;
InputStream is = new ByteArrayInputStream(new byte[contentLength]);
InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is);
MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null);
HttpResponse response = uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL));
assertEquals(500, response.getStatusCode());
// There should be 3 calls made. 1 initiation request, 1 successful upload request and 1 upload
// request with server error
assertEquals(3, fakeTransport.lowLevelExecCalls);