@@ -75,8 +75,6 @@ public void testRetrySuccess() throws DbxException, IOException {
7575 DbxClientV2 client = new DbxClientV2 (config , "fakeAccessToken" );
7676 FileMetadata expected = new FileMetadata (
7777 "bar.txt" ,
78- "/foo/bar.txt" ,
79- "/foo/bar.txt" ,
8078 "id:1HkLjqifwMAAAAAAAAAAAQ" ,
8179 new Date (1456169040985L ),
8280 new Date (1456169040985L ),
@@ -94,13 +92,14 @@ public void testRetrySuccess() throws DbxException, IOException {
9492 when (mockRequestor .startPost (anyString (), anyHeaders ()))
9593 .thenReturn (mockUploader );
9694
97- Metadata actual = client .files ().getMetadata (expected .getPathLower ());
95+ Metadata actual = client .files ().getMetadata (expected .getId ());
9896
9997 // should have only been called 3 times: initial call + 2 retries
10098 verify (mockRequestor , times (3 )).startPost (anyString (), anyHeaders ());
10199
102- assertEquals (actual .getPathLower (), expected .getPathLower ());
100+ assertEquals (actual .getName (), expected .getName ());
103101 assertTrue (actual instanceof FileMetadata , actual .getClass ().toString ());
102+ assertEquals (((FileMetadata ) actual ).getId (), expected .getId ());
104103 }
105104
106105 @ Test (expectedExceptions = RetryException .class )
@@ -166,8 +165,6 @@ public void testRetryDownload() throws DbxException, IOException {
166165
167166 FileMetadata expectedMetadata = new FileMetadata (
168167 "download_me.txt" ,
169- "/download_me.txt" ,
170- "/download_me.txt" ,
171168 "id:KLavC4viCDAAAAAAAAAAAQ" ,
172169 new Date (1456169692501L ),
173170 new Date (1456169692501L ),
@@ -184,7 +181,7 @@ public void testRetryDownload() throws DbxException, IOException {
184181 when (mockRequestor .startPost (anyString (), anyHeaders ()))
185182 .thenReturn (mockUploader );
186183
187- DbxDownloader <FileMetadata > downloader = client .files ().download (expectedMetadata .getPathLower ());
184+ DbxDownloader <FileMetadata > downloader = client .files ().download (expectedMetadata .getId ());
188185
189186 // should have been attempted twice
190187 verify (mockRequestor , times (2 )).startPost (anyString (), anyHeaders ());
@@ -208,8 +205,6 @@ public void testRetrySuccessWithBackoff() throws DbxException, IOException {
208205 DbxClientV2 client = new DbxClientV2 (config , "fakeAccessToken" );
209206 FileMetadata expected = new FileMetadata (
210207 "banana.png" ,
211- "/banana.png" ,
212- "/banana.png" ,
213208 "id:eRsVsAya9YAAAAAAAAAAAQ" ,
214209 new Date (1456173312172L ),
215210 new Date (1456173312172L ),
@@ -229,7 +224,7 @@ public void testRetrySuccessWithBackoff() throws DbxException, IOException {
229224 .thenReturn (mockUploader );
230225
231226 long start = System .currentTimeMillis ();
232- Metadata actual = client .files ().getMetadata (expected .getPathLower ());
227+ Metadata actual = client .files ().getMetadata (expected .getId ());
233228 long end = System .currentTimeMillis ();
234229
235230 // no way easy way to properly test this, but request should
@@ -239,7 +234,7 @@ public void testRetrySuccessWithBackoff() throws DbxException, IOException {
239234 // should have been called 4 times: initial call + 3 retries
240235 verify (mockRequestor , times (4 )).startPost (anyString (), anyHeaders ());
241236
242- assertEquals (actual .getPathLower (), expected .getPathLower ());
237+ assertEquals (actual .getName (), expected .getName ());
243238 assertTrue (actual instanceof FileMetadata , actual .getClass ().toString ());
244239 }
245240
0 commit comments