@@ -304,9 +304,9 @@ public void shouldParsePlainTextErrorResponse() throws Exception {
304304 }
305305
306306 @ Test
307- public void shouldReceiveRateLimitsResponse () throws Exception {
307+ public void shouldParseRateLimitsHeaders () throws Exception {
308308 CustomRequest <List > request = new CustomRequest <>(client , server .getBaseUrl (), "GET" , listType );
309- server .rateLimitReachedResponse (100 , - 1 , 5 );
309+ server .rateLimitReachedResponse (100 , 10 , 5 );
310310 Exception exception = null ;
311311 try {
312312 request .execute ();
@@ -324,12 +324,12 @@ public void shouldReceiveRateLimitsResponse() throws Exception {
324324 assertThat (rateLimitException .getValue ("non_existing_key" ), is (nullValue ()));
325325 assertThat (rateLimitException .getStatusCode (), is (429 ));
326326 assertThat (rateLimitException .getLimit (), is (100L ));
327- assertThat (rateLimitException .getRemaining (), is (- 1L ));
327+ assertThat (rateLimitException .getRemaining (), is (10L ));
328328 assertThat (rateLimitException .getReset (), is (5L ));
329329 }
330330
331331 @ Test
332- public void shouldReceiveDefaultsRateLimitsResponse () throws Exception {
332+ public void shouldDefaultRateLimitsHeadersWhenMissing () throws Exception {
333333 CustomRequest <List > request = new CustomRequest <>(client , server .getBaseUrl (), "GET" , listType );
334334 server .rateLimitReachedResponse (-1 , -1 , -1 );
335335 Exception exception = null ;
@@ -353,4 +353,4 @@ public void shouldReceiveDefaultsRateLimitsResponse() throws Exception {
353353 assertThat (rateLimitException .getReset (), is (-1L ));
354354 }
355355
356- }
356+ }
0 commit comments