()
| 23 | } |
| 24 | |
| 25 | @Test |
| 26 | public void testRateLimiting() throws IOException |
| 27 | { |
| 28 | dispatcher.registerResponse("GET", "http://app/users/me").code(429).addHeader("Retry-After", "1.0"); |
| 29 | dispatcher.registerResponse("GET", "http://app/users/me").code(200).content("{ \"data\": { \"name\": \"me\" }}"); |
| 30 | |
| 31 | assertEquals("me", client.users.me().execute().name); |
| 32 | assertEquals(2, dispatcher.calls.size()); |
| 33 | assertEquals(Arrays.asList(1000), dispatcher.sleepCalls); |
| 34 | } |
| 35 | |
| 36 | @Test |
| 37 | public void testRateLimitedTwice() throws IOException |
nothing calls this directly
no test coverage detected