11package com .microsoft .graph .functional ;
22
3+ import static org .junit .Assert .assertTrue ;
4+
35import java .io .IOException ;
46import java .io .InputStream ;
57
@@ -32,7 +34,7 @@ public void setUp() {
3234 * @throws InterruptedException if the chunked upload fails
3335 */
3436 @ Test
35- public void testLargeFileUpload () throws IOException , InterruptedException {
37+ public void testLargeFileUpload () throws IOException , InterruptedException {
3638 String itemId = "01BQHXQL5GQVAGCFJLYRH3EAG2YHGERMQA" ; //Test upload folder
3739
3840 //Get resource file from file system
@@ -67,7 +69,6 @@ public void failure(final ClientException ex) {
6769 .createUploadSession (new DriveItemUploadableProperties ())
6870 .buildRequest ()
6971 .post ();
70-
7172 ChunkedUploadProvider <DriveItem > chunkedUploadProvider = new ChunkedUploadProvider <DriveItem >(
7273 uploadSession ,
7374 testBase .graphClient ,
@@ -77,5 +78,11 @@ public void failure(final ClientException ex) {
7778
7879 chunkedUploadProvider .upload (callback );
7980 }
80-
81+ @ Test
82+ public void testDownloadWithCustomRequest () throws IOException {
83+ final String testDownloadFileId = "01RWFXFJG3UYRHE75RZVFYWKNUEBB53H7A" ;
84+ final InputStream stream = testBase .graphClient .customRequest ("/me/drive/items/" +testDownloadFileId +"/content" , InputStream .class ).buildRequest ().get ();
85+ final byte [] bytes = stream .readAllBytes ();
86+ assertTrue ("stream should not be empty" , bytes .length > 0 );
87+ }
8188}
0 commit comments