InputStream is = new ByteArrayInputStream(new byte[contentLength]);
InputStreamContent mediaContent = new InputStreamContent(TEST_CONTENT_TYPE, is);
mediaContent.setLength(contentLength);
MediaHttpUploader uploader = new MediaHttpUploader(mediaContent, fakeTransport, null);
uploader.getInitiationHeaders().set("test-header-name", "test-header-value");
uploader.upload(new GenericUrl(TEST_RESUMABLE_REQUEST_URL));
// There should be 6 calls made. 1 initiation request and 5 upload requests.
assertEquals(6, fakeTransport.lowLevelExecCalls);
}