ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
MediaTransport fakeTransport = new MediaTransport(contentLength);
fakeTransport.directDownloadEnabled = true;
MediaHttpDownloader downloader = new MediaHttpDownloader(fakeTransport, null);
downloader.setDirectDownloadEnabled(true);
downloader.download(new GenericUrl(TEST_REQUEST_URL), outputStream);
assertEquals(TEST_CHUNK_SIZE, outputStream.size());
// There should be 1 download call made.
assertEquals(1, fakeTransport.lowLevelExecCalls);
}