MCPcopy Create free account
hub / github.com/Asana/java-asana / testRateLimiting

Method testRateLimiting

src/test/java/com/asana/RateLimitTest.java:25–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

codeMethod · 0.80
registerResponseMethod · 0.80
contentMethod · 0.80
meMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected