Integrate full rate limit checking

This commit is contained in:
Liam Newman
2020-05-26 15:23:31 -07:00
parent 580f2537f2
commit 4ef0d00846
9 changed files with 431 additions and 254 deletions

View File

@@ -32,6 +32,7 @@ public class RateLimitCheckerTest extends AbstractGitHubWireMockTest {
public void testGitHubRateLimit() throws Exception {
// Customized response that templates the date to keep things working
snapshotNotAllowed();
GHRateLimit.UnknownLimitRecord.reset();
assertThat(mockGitHub.getRequestCount(), equalTo(0));
@@ -45,7 +46,7 @@ public class RateLimitCheckerTest extends AbstractGitHubWireMockTest {
.withEndpoint(mockGitHub.apiServer().baseUrl())
.build();
assertThat(gitHub.lastRateLimit(), nullValue());
assertThat(gitHub.lastRateLimit(), equalTo(GHRateLimit.Default()));
// Checks the rate limit before getting myself
gitHub.getMyself();