Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseman committed Sep 14, 2024
1 parent 0875baf commit 11fdeec
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
<version>2.0.0-beta1-SNAPSHOT</version>
<version>2.0.0-alpha-1-SNAPSHOT</version>
<name>GitHub API for Java</name>
<url>https://github-api.kohsuke.org/</url>
<description>GitHub API for Java</description>
Expand Down
9 changes: 4 additions & 5 deletions src/test/java/org/kohsuke/github/AbuseLimitHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ public void onError(@NotNull GitHubConnectorResponse connectorResponse) throws I

assertThat(connectorResponse.header("Status"), equalTo("403 Forbidden"));


checkErrorMessageMatches(connectorResponse,
"You have exceeded a secondary rate limit. Please wait a few minutes before you try again");
GitHubAbuseLimitHandler.WAIT.onError(connectorResponse);
Expand All @@ -388,7 +387,7 @@ public void onError(@NotNull GitHubConnectorResponse connectorResponse) throws I
assertThat(mockGitHub.getRequestCount(), equalTo(1));

getTempRepository();
assertThat(mockGitHub.getRequestCount(), equalTo(3));
assertThat(mockGitHub.getRequestCount(), equalTo(3));
}

/**
Expand Down Expand Up @@ -452,7 +451,7 @@ public void onError(@NotNull GitHubConnectorResponse connectorResponse) throws I
assertThat(mockGitHub.getRequestCount(), equalTo(1));

getTempRepository();
assertThat(mockGitHub.getRequestCount(), equalTo(3));
assertThat(mockGitHub.getRequestCount(), equalTo(3));
}

/**
Expand Down Expand Up @@ -499,7 +498,7 @@ public void onError(@NotNull GitHubConnectorResponse connectorResponse) throws I
assertThat(mockGitHub.getRequestCount(), equalTo(1));

getTempRepository();
assertThat(mockGitHub.getRequestCount(), equalTo(3));
assertThat(mockGitHub.getRequestCount(), equalTo(3));
}

/**
Expand Down Expand Up @@ -538,7 +537,7 @@ public void onError(@NotNull GitHubConnectorResponse connectorResponse) throws I
GitHubAbuseLimitHandler.DEFAULT_WAIT_MILLIS = 3210l;
long waitTime = parseWaitTime(connectorResponse);
assertThat(waitTime, equalTo(GitHubAbuseLimitHandler.DEFAULT_WAIT_MILLIS));

GitHubAbuseLimitHandler.WAIT.onError(connectorResponse);
}
})
Expand Down
6 changes: 6 additions & 0 deletions src/test/resources/no-reflect-and-serialization-list
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ org.kohsuke.github.GitHub
org.kohsuke.github.GitHub$DependentAuthorizationProvider
org.kohsuke.github.GitHub$LoginLoadingUserAuthorizationProvider
org.kohsuke.github.GitHubAbuseLimitHandler
org.kohsuke.github.GitHubAbuseLimitHandler$1
org.kohsuke.github.GitHubAbuseLimitHandler$2
org.kohsuke.github.GitHubClient
org.kohsuke.github.GitHubClient$BodyHandler
org.kohsuke.github.GitHubClient$GHApiInfo
Expand All @@ -26,6 +28,8 @@ org.kohsuke.github.GitHubConnectorResponseErrorHandler
org.kohsuke.github.GitHubPageIterator
org.kohsuke.github.GitHubRateLimitChecker
org.kohsuke.github.GitHubRateLimitHandler
org.kohsuke.github.GitHubRateLimitHandler$1
org.kohsuke.github.GitHubRateLimitHandler$2
org.kohsuke.github.HttpConnector
org.kohsuke.github.HttpException
org.kohsuke.github.PagedIterator
Expand All @@ -44,6 +48,7 @@ org.kohsuke.github.authorization.ImmutableAuthorizationProvider$UserProvider
org.kohsuke.github.authorization.OrgAppInstallationAuthorizationProvider
org.kohsuke.github.authorization.UserAuthorizationProvider
org.kohsuke.github.connector.GitHubConnector
org.kohsuke.github.connector.GitHubConnector$1
org.kohsuke.github.connector.GitHubConnectorRequest
org.kohsuke.github.connector.GitHubConnectorResponse
org.kohsuke.github.connector.GitHubConnectorResponse$ByteArrayResponse
Expand All @@ -63,6 +68,7 @@ org.kohsuke.github.extras.authorization.JwtBuilderUtil$IJwtBuilder
org.kohsuke.github.extras.authorization.JwtBuilderUtil$ReflectionBuilderImpl
org.kohsuke.github.extras.authorization.JWTTokenProvider
org.kohsuke.github.extras.HttpClientGitHubConnector
org.kohsuke.github.extras.HttpClientGitHubConnector$HttpClientGitHubConnectorResponse
org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$1
org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$BufferedRequestBody
org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"X-GitHub-Request-Id": "CC37:2605:3F982:4E949:5E3C5BFC"
}
},
"uuid": "19fb1092-8bf3-4274-bc8e-ca126c9d9261",
"uuid": "79fb1092-8bf3-4274-bc8e-ca126c9d9261",
"persistent": true,
"scenarioName": "scenario-1-repos-hub4j-test-org-temp-testHandler_Wait_Secondary_Limits1",
"requiredScenarioState": "Started",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "574da117-6845-46d8-b2c1-4415546ca670",
"name": "repos_hub4j-test-org_temp-testHandler_Wait_Secondary_Limits",
"name": "repos_hub4j-test-org_temp-testHandler_Wait_Secondary_Limits_Too_Many_Requests",
"request": {
"url": "/repos/hub4j-test-org/temp-testHandler_Wait_Secondary_Limits",
"url": "/repos/hub4j-test-org/temp-testHandler_Wait_Secondary_Limits_Too_Many_Requests",
"method": "GET",
"headers": {
"Accept": {
Expand Down Expand Up @@ -42,7 +42,7 @@
"X-GitHub-Request-Id": "CC37:2605:3FADC:4EA8C:5E3C5C02"
}
},
"uuid": "174da117-6845-46d8-b2c1-4415546ca670",
"uuid": "574da117-6845-46d8-b2c1-4415546ca670",
"persistent": true,
"scenarioName": "scenario-1-repos-hub4j-test-org-temp-testHandler_Wait_Secondary_Limits1",
"requiredScenarioState": "scenario-1-repos-hub4j-test-org-temp-testHandler_Wait_Secondary_Limits1-2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"X-GitHub-Request-Id": "CC37:2605:3F982:4E949:5E3C5BFC"
}
},
"uuid": "22fb1092-8bf3-4274-bc8e-ca126c9d9261",
"uuid": "79fb1092-8bf3-4274-bc8e-ca126c9d9261",
"persistent": true,
"scenarioName": "scenario-1-repos-hub4j-test-org-temp-testHandler_Wait_Secondary_Limits2",
"requiredScenarioState": "Started",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"X-GitHub-Request-Id": "CC37:2605:3FADC:4EA8C:5E3C5C02"
}
},
"uuid": "274da117-6845-46d8-b2c1-4415546ca670",
"uuid": "574da117-6845-46d8-b2c1-4415546ca670",
"persistent": true,
"scenarioName": "scenario-1-repos-hub4j-test-org-temp-testHandler_Wait_Secondary_Limits2",
"requiredScenarioState": "scenario-1-repos-hub4j-test-org-temp-testHandler_Wait_Secondary_Limits2-2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"X-GitHub-Request-Id": "CC37:2605:3F982:4E949:5E3C5BFC"
}
},
"uuid": "39fb1092-8bf3-4274-bc8e-ca126c9d9261",
"uuid": "79fb1092-8bf3-4274-bc8e-ca126c9d9261",
"persistent": true,
"scenarioName": "scenario-1-repos-hub4j-test-org-temp-testHandler_Wait_Secondary_Limits3",
"requiredScenarioState": "Started",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"X-GitHub-Request-Id": "CC37:2605:3FADC:4EA8C:5E3C5C02"
}
},
"uuid": "374da117-6845-46d8-b2c1-4415546ca670",
"uuid": "574da117-6845-46d8-b2c1-4415546ca670",
"persistent": true,
"scenarioName": "scenario-1-repos-hub4j-test-org-temp-testHandler_Wait_Secondary_Limits3",
"requiredScenarioState": "scenario-1-repos-hub4j-test-org-temp-testHandler_Wait_Secondary_Limits3-2",
Expand Down

0 comments on commit 11fdeec

Please sign in to comment.