From 4e445984f1c11a8be3b51cb2efc5e06f151a85e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 10:19:09 -0700 Subject: [PATCH 01/23] Chore(deps): Bump release-drafter/release-drafter from 6 to 7 (#2215) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 6 to 7. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v6...v7) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 1b55f3d0c9..f182c798df 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -17,6 +17,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Release Drafter - uses: release-drafter/release-drafter@v6 + uses: release-drafter/release-drafter@v7 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From da1b8aeaaa24a045c85dcc3c9a8066566943bfb6 Mon Sep 17 00:00:00 2001 From: Roman Zabaluev Date: Wed, 8 Apr 2026 01:20:16 +0800 Subject: [PATCH 02/23] Fix getLabel() nullability for unlabeled events when label was deleted (#2211) --- .../org/kohsuke/github/GHEventPayload.java | 16 +- .../kohsuke/github/GHEventPayloadTest.java | 15 ++ .../issue_unlabeled_deleted_label.json | 167 ++++++++++++++++++ 3 files changed, 195 insertions(+), 3 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHEventPayloadTest/issue_unlabeled_deleted_label.json diff --git a/src/main/java/org/kohsuke/github/GHEventPayload.java b/src/main/java/org/kohsuke/github/GHEventPayload.java index d4d0af2b77..12a95e0979 100644 --- a/src/main/java/org/kohsuke/github/GHEventPayload.java +++ b/src/main/java/org/kohsuke/github/GHEventPayload.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.infradna.tool.bridge_method_injector.WithBridgeMethods; +import edu.umd.cs.findbugs.annotations.CheckForNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; @@ -445,8 +446,11 @@ public GHRepositoryDiscussion getDiscussion() { /** * Gets the added or removed label for labeled/unlabeled events. * - * @return label the added or removed label + * May be {@code null} when the unlabeled event was triggered by deleting the label from the repository. + * + * @return label the added or removed label, or {@code null} if the label was deleted */ + @CheckForNull @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected") public GHLabel getLabel() { return label; @@ -785,8 +789,11 @@ public GHIssue getIssue() { /** * Gets the added or removed label for labeled/unlabeled events. * - * @return label the added or removed label + * May be {@code null} when the unlabeled event was triggered by deleting the label from the repository. + * + * @return label the added or removed label, or {@code null} if the label was deleted */ + @CheckForNull @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected") public GHLabel getLabel() { return label; @@ -1103,8 +1110,11 @@ public GHPullRequestChanges getChanges() { /** * Gets the added or removed label for labeled/unlabeled events. * - * @return label the added or removed label + * May be {@code null} when the unlabeled event was triggered by deleting the label from the repository. + * + * @return label the added or removed label, or {@code null} if the label was deleted */ + @CheckForNull @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected") public GHLabel getLabel() { return label; diff --git a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java index 44e05d3aee..aa0186075e 100644 --- a/src/test/java/org/kohsuke/github/GHEventPayloadTest.java +++ b/src/test/java/org/kohsuke/github/GHEventPayloadTest.java @@ -690,6 +690,21 @@ public void issue_unlabeled() throws Exception { assertThat(event.getLabel().getName(), is("enhancement")); } + /** + * Issue unlabeled when label was deleted from repository. + * + * @throws Exception + * the exception + */ + @Test + public void issue_unlabeled_deleted_label() throws Exception { + final GHEventPayload.Issue event = GitHub.offline() + .parseEventPayload(payload.asReader(), GHEventPayload.Issue.class); + assertThat(event.getAction(), is("unlabeled")); + assertThat(event.getIssue().getNumber(), is(42)); + assertThat(event.getLabel(), is(nullValue())); + } + /** * Issues. * diff --git a/src/test/resources/org/kohsuke/github/GHEventPayloadTest/issue_unlabeled_deleted_label.json b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/issue_unlabeled_deleted_label.json new file mode 100644 index 0000000000..d2ee928a6a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHEventPayloadTest/issue_unlabeled_deleted_label.json @@ -0,0 +1,167 @@ +{ + "action": "unlabeled", + "issue": { + "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/42", + "repository_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground", + "labels_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/42/labels{/name}", + "comments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/42/comments", + "events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/42/events", + "html_url": "https://github.com/gsmet/quarkus-bot-java-playground/issues/42", + "id": 835908684, + "node_id": "MDU6SXNzdWU4MzU5MDg2ODQ=", + "number": 42, + "title": "Test GHEventPayload.Issue label/unlabel", + "user": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "labels": [], + "state": "open", + "locked": false, + "assignee": null, + "assignees": [], + "milestone": null, + "comments": 0, + "created_at": "2021-03-19T12:02:09Z", + "updated_at": "2021-03-19T12:02:43Z", + "closed_at": null, + "author_association": "OWNER", + "active_lock_reason": null, + "body": "", + "performed_via_github_app": null + }, + "repository": { + "id": 313384129, + "node_id": "MDEwOlJlcG9zaXRvcnkzMTMzODQxMjk=", + "name": "quarkus-bot-java-playground", + "full_name": "gsmet/quarkus-bot-java-playground", + "private": true, + "owner": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/gsmet/quarkus-bot-java-playground", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground", + "forks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/forks", + "keys_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/teams", + "hooks_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/hooks", + "issue_events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/events{/number}", + "events_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/events", + "assignees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/assignees{/user}", + "branches_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/branches{/branch}", + "tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/tags", + "blobs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/statuses/{sha}", + "languages_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/languages", + "stargazers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/stargazers", + "contributors_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contributors", + "subscribers_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscribers", + "subscription_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/subscription", + "commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/contents/{+path}", + "compare_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/merges", + "archive_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/downloads", + "issues_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/issues{/number}", + "pulls_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/pulls{/number}", + "milestones_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/milestones{/number}", + "notifications_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/labels{/name}", + "releases_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/releases{/id}", + "deployments_url": "https://api.github.com/repos/gsmet/quarkus-bot-java-playground/deployments", + "created_at": "2020-11-16T17:55:53Z", + "updated_at": "2020-12-01T08:39:07Z", + "pushed_at": "2020-12-01T08:39:05Z", + "git_url": "git://github.com/gsmet/quarkus-bot-java-playground.git", + "ssh_url": "git@github.com:gsmet/quarkus-bot-java-playground.git", + "clone_url": "https://github.com/gsmet/quarkus-bot-java-playground.git", + "svn_url": "https://github.com/gsmet/quarkus-bot-java-playground", + "homepage": null, + "size": 13, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 14, + "license": null, + "forks": 1, + "open_issues": 14, + "watchers": 0, + "default_branch": "main" + }, + "sender": { + "login": "gsmet", + "id": 1279749, + "node_id": "MDQ6VXNlcjEyNzk3NDk=", + "avatar_url": "https://avatars.githubusercontent.com/u/1279749?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/gsmet", + "html_url": "https://github.com/gsmet", + "followers_url": "https://api.github.com/users/gsmet/followers", + "following_url": "https://api.github.com/users/gsmet/following{/other_user}", + "gists_url": "https://api.github.com/users/gsmet/gists{/gist_id}", + "starred_url": "https://api.github.com/users/gsmet/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/gsmet/subscriptions", + "organizations_url": "https://api.github.com/users/gsmet/orgs", + "repos_url": "https://api.github.com/users/gsmet/repos", + "events_url": "https://api.github.com/users/gsmet/events{/privacy}", + "received_events_url": "https://api.github.com/users/gsmet/received_events", + "type": "User", + "site_admin": false + }, + "installation": { + "id": 13005535, + "node_id": "MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uMTMwMDU1MzU=" + } +} From eb12f66f92958c8a8b2b289f14cad969ba3bf4f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 10:31:02 -0700 Subject: [PATCH 03/23] Chore(deps): Bump codecov/codecov-action from 5.5.2 to 6.0.0 (#2213) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.5.2 to 6.0.0. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v5.5.2...v6.0.0) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/maven-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 04fc23ec09..0806499282 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -126,7 +126,7 @@ jobs: name: maven-test-target-directory path: target - name: Codecov Report - uses: codecov/codecov-action@v5.5.2 + uses: codecov/codecov-action@v6.0.0 with: # Codecov token from https://app.codecov.io/gh/hub4j/github-api/settings token: ${{ secrets.CODECOV_TOKEN }} From 94bcfe3eae6601f00cee21aae5f25fba356a2882 Mon Sep 17 00:00:00 2001 From: Pierre Villard Date: Fri, 10 Apr 2026 03:18:54 +0200 Subject: [PATCH 04/23] Add support for specifying Author and Committer (issue #2199) (#2200) * Add support for specifying Author and Committer * review wrt test coverage * review --- .../java/org/kohsuke/github/GHContent.java | 28 ++ .../org/kohsuke/github/GHContentBuilder.java | 110 ++++++ .../org/kohsuke/github/GHContentDeleter.java | 177 ++++++++++ .../org/kohsuke/github/GHContentUpdater.java | 205 ++++++++++++ .../github-api/reflect-config.json | 75 +++++ .../github-api/serialization-config.json | 15 + .../github/GHContentIntegrationTest.java | 156 +++++++++ .../__files/1-user.json | 45 +++ .../2-r_h_ghcontentintegrationtest.json | 313 ++++++++++++++++++ ..._h_temp-testCreateWithAuthorCommitter.json | 71 ++++ ..._h_t_contents_author-committer-testmd.json | 52 +++ .../mappings/1-user.json | 48 +++ .../2-r_h_ghcontentintegrationtest.json | 48 +++ ..._h_temp-testCreateWithAuthorCommitter.json | 24 ++ ..._h_t_contents_author-committer-testmd.json | 31 ++ .../__files/1-user.json | 45 +++ .../2-r_h_ghcontentintegrationtest.json | 313 ++++++++++++++++++ ...-testCreateWithAuthorCommitterAndDate.json | 71 ++++ ..._h_t_contents_author-committer-testmd.json | 52 +++ .../mappings/1-user.json | 48 +++ .../2-r_h_ghcontentintegrationtest.json | 48 +++ ...-testCreateWithAuthorCommitterAndDate.json | 24 ++ ..._h_t_contents_author-committer-testmd.json | 31 ++ .../__files/1-user.json | 45 +++ .../2-r_h_ghcontentintegrationtest.json | 313 ++++++++++++++++++ ...ents_ghcontent-ro_a-file-with-content.json | 18 + ...content-ro_a-file-with-content-delete.json | 37 +++ .../mappings/1-user.json | 48 +++ .../2-r_h_ghcontentintegrationtest.json | 48 +++ ...ents_ghcontent-ro_a-file-with-content.json | 24 ++ ...content-ro_a-file-with-content-delete.json | 31 ++ .../__files/1-user.json | 45 +++ .../2-r_h_ghcontentintegrationtest.json | 313 ++++++++++++++++++ ...ents_ghcontent-ro_a-file-with-content.json | 18 + ...content-ro_a-file-with-content-delete.json | 37 +++ .../mappings/1-user.json | 48 +++ .../2-r_h_ghcontentintegrationtest.json | 48 +++ ...ents_ghcontent-ro_a-file-with-content.json | 24 ++ ...content-ro_a-file-with-content-delete.json | 31 ++ .../__files/1-user.json | 45 +++ .../2-r_h_ghcontentintegrationtest.json | 313 ++++++++++++++++++ ...ents_ghcontent-ro_a-file-with-content.json | 18 + ...content-ro_a-file-with-content-update.json | 52 +++ .../mappings/1-user.json | 48 +++ .../2-r_h_ghcontentintegrationtest.json | 48 +++ ...ents_ghcontent-ro_a-file-with-content.json | 24 ++ ...content-ro_a-file-with-content-update.json | 31 ++ .../__files/1-user.json | 45 +++ .../2-r_h_ghcontentintegrationtest.json | 313 ++++++++++++++++++ ...ents_ghcontent-ro_a-file-with-content.json | 18 + ...content-ro_a-file-with-content-update.json | 52 +++ .../mappings/1-user.json | 48 +++ .../2-r_h_ghcontentintegrationtest.json | 48 +++ ...ents_ghcontent-ro_a-file-with-content.json | 24 ++ ...content-ro_a-file-with-content-update.json | 31 ++ 55 files changed, 4316 insertions(+) create mode 100644 src/main/java/org/kohsuke/github/GHContentDeleter.java create mode 100644 src/main/java/org/kohsuke/github/GHContentUpdater.java create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/3-r_h_temp-testCreateWithAuthorCommitter.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/4-r_h_t_contents_author-committer-testmd.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/3-r_h_temp-testCreateWithAuthorCommitter.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/4-r_h_t_contents_author-committer-testmd.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/3-r_h_temp-testCreateWithAuthorCommitterAndDate.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/4-r_h_t_contents_author-committer-testmd.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/3-r_h_temp-testCreateWithAuthorCommitterAndDate.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/4-r_h_t_contents_author-committer-testmd.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/1-user.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json create mode 100644 src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json diff --git a/src/main/java/org/kohsuke/github/GHContent.java b/src/main/java/org/kohsuke/github/GHContent.java index d6d9549b01..98d94da4ab 100644 --- a/src/main/java/org/kohsuke/github/GHContent.java +++ b/src/main/java/org/kohsuke/github/GHContent.java @@ -56,6 +56,34 @@ static String getApiRoute(GHRepository repository, String path) { public GHContent() { } + /** + * Creates a builder that can be used to delete this file. + * + *

+ * Unlike the {@link #delete(String)} convenience methods, this builder supports setting the author and committer of + * the resulting commit. + * + * @return a content deleter + * @see GHContentDeleter + */ + public GHContentDeleter createDelete() { + return new GHContentDeleter(this); + } + + /** + * Creates a builder that can be used to update this file's content. + * + *

+ * Unlike the {@link #update(String, String)} convenience methods, this builder supports setting the author and + * committer of the resulting commit. + * + * @return a content updater + * @see GHContentUpdater + */ + public GHContentUpdater createUpdate() { + return new GHContentUpdater(this); + } + /** * Delete gh content update response. * diff --git a/src/main/java/org/kohsuke/github/GHContentBuilder.java b/src/main/java/org/kohsuke/github/GHContentBuilder.java index 11a77ab1b8..3ae0e8a941 100644 --- a/src/main/java/org/kohsuke/github/GHContentBuilder.java +++ b/src/main/java/org/kohsuke/github/GHContentBuilder.java @@ -1,8 +1,13 @@ package org.kohsuke.github; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.time.Instant; import java.util.Base64; +import java.util.Date; // TODO: Auto-generated Javadoc /** @@ -15,6 +20,19 @@ * @see GHRepository#createContent() GHRepository#createContent() */ public final class GHContentBuilder { + @JsonInclude(Include.NON_NULL) + private static final class UserInfo { + private final String date; + private final String email; + private final String name; + + private UserInfo(String name, String email, Instant date) { + this.name = name; + this.email = email; + this.date = date != null ? GitHubClient.printInstant(date) : null; + } + } + private String path; private final GHRepository repo; private final Requester req; @@ -30,6 +48,52 @@ public final class GHContentBuilder { this.req = repo.root().createRequest().method("PUT"); } + /** + * Configures the author of the commit. If not specified, the authenticated user is used as the author. + * + * @param name + * the name of the author + * @param email + * the email of the author + * @return the gh content builder + */ + public GHContentBuilder author(String name, String email) { + return author(name, email, (Instant) null); + } + + /** + * Configures the author of the commit. If not specified, the authenticated user is used as the author. + * + * @param name + * the name of the author + * @param email + * the email of the author + * @param date + * the date of the authoring + * @return the gh content builder + * @deprecated use {@link #author(String, String, Instant)} instead + */ + @Deprecated + public GHContentBuilder author(String name, String email, Date date) { + return author(name, email, GitHubClient.toInstantOrNull(date)); + } + + /** + * Configures the author of the commit. If not specified, the authenticated user is used as the author. + * + * @param name + * the name of the author + * @param email + * the email of the author + * @param date + * the timestamp for the authoring + * @return the gh content builder + */ + public GHContentBuilder author(String name, String email, Instant date) { + req.with("author", new UserInfo(name, email, date)); + return this; + } + /** * Branch gh content builder. * @@ -59,6 +123,52 @@ public GHContentUpdateResponse commit() throws IOException { return response; } + /** + * Configures the committer of the commit. If not specified, the authenticated user is used as the committer. + * + * @param name + * the name of the committer + * @param email + * the email of the committer + * @return the gh content builder + */ + public GHContentBuilder committer(String name, String email) { + return committer(name, email, (Instant) null); + } + + /** + * Configures the committer of the commit. If not specified, the authenticated user is used as the committer. + * + * @param name + * the name of the committer + * @param email + * the email of the committer + * @param date + * the date of the commit + * @return the gh content builder + * @deprecated use {@link #committer(String, String, Instant)} instead + */ + @Deprecated + public GHContentBuilder committer(String name, String email, Date date) { + return committer(name, email, GitHubClient.toInstantOrNull(date)); + } + + /** + * Configures the committer of the commit. If not specified, the authenticated user is used as the committer. + * + * @param name + * the name of the committer + * @param email + * the email of the committer + * @param date + * the timestamp of the commit + * @return the gh content builder + */ + public GHContentBuilder committer(String name, String email, Instant date) { + req.with("committer", new UserInfo(name, email, date)); + return this; + } + /** * Content gh content builder. * diff --git a/src/main/java/org/kohsuke/github/GHContentDeleter.java b/src/main/java/org/kohsuke/github/GHContentDeleter.java new file mode 100644 index 0000000000..03d4c31e28 --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHContentDeleter.java @@ -0,0 +1,177 @@ +package org.kohsuke.github; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.IOException; +import java.time.Instant; +import java.util.Date; + +/** + * Builder for deleting repository content with support for specifying author and committer information. + * + *

+ * Obtain an instance via {@link GHContent#createDelete()}. + * + * @see GHContent#createDelete() + */ +public final class GHContentDeleter { + @JsonInclude(Include.NON_NULL) + private static final class UserInfo { + private final String date; + private final String email; + private final String name; + + private UserInfo(String name, String email, Instant date) { + this.name = name; + this.email = email; + this.date = date != null ? GitHubClient.printInstant(date) : null; + } + } + + private final GHContent content; + private final Requester req; + + GHContentDeleter(GHContent content) { + this.content = content; + final GHRepository repository = content.getOwner(); + this.req = repository.root() + .createRequest() + .method("DELETE") + .inBody() + .with("path", content.getPath()) + .with("sha", content.getSha()); + } + + /** + * Configures the author of the commit. If not specified, the authenticated user is used as the author. + * + * @param name + * the name of the author + * @param email + * the email of the author + * @return this deleter + */ + public GHContentDeleter author(String name, String email) { + return author(name, email, (Instant) null); + } + + /** + * Configures the author of the commit. If not specified, the authenticated user is used as the author. + * + * @param name + * the name of the author + * @param email + * the email of the author + * @param date + * the date of the authoring + * @return this deleter + * @deprecated use {@link #author(String, String, Instant)} instead + */ + @Deprecated + public GHContentDeleter author(String name, String email, Date date) { + return author(name, email, GitHubClient.toInstantOrNull(date)); + } + + /** + * Configures the author of the commit. If not specified, the authenticated user is used as the author. + * + * @param name + * the name of the author + * @param email + * the email of the author + * @param date + * the timestamp for the authoring + * @return this deleter + */ + public GHContentDeleter author(String name, String email, Instant date) { + req.with("author", new UserInfo(name, email, date)); + return this; + } + + /** + * Sets the branch to delete the content from. + * + * @param branch + * the branch name + * @return this deleter + */ + public GHContentDeleter branch(String branch) { + req.with("branch", branch); + return this; + } + + /** + * Commits the deletion. + * + * @return the response containing the commit information + * @throws IOException + * the io exception + */ + public GHContentUpdateResponse commit() throws IOException { + final GHRepository repository = content.getOwner(); + GHContentUpdateResponse response = req.withUrlPath(GHContent.getApiRoute(repository, content.getPath())) + .fetch(GHContentUpdateResponse.class); + + response.getCommit().wrapUp(repository); + return response; + } + + /** + * Configures the committer of the commit. If not specified, the authenticated user is used as the committer. + * + * @param name + * the name of the committer + * @param email + * the email of the committer + * @return this deleter + */ + public GHContentDeleter committer(String name, String email) { + return committer(name, email, (Instant) null); + } + + /** + * Configures the committer of the commit. If not specified, the authenticated user is used as the committer. + * + * @param name + * the name of the committer + * @param email + * the email of the committer + * @param date + * the date of the commit + * @return this deleter + * @deprecated use {@link #committer(String, String, Instant)} instead + */ + @Deprecated + public GHContentDeleter committer(String name, String email, Date date) { + return committer(name, email, GitHubClient.toInstantOrNull(date)); + } + + /** + * Configures the committer of the commit. If not specified, the authenticated user is used as the committer. + * + * @param name + * the name of the committer + * @param email + * the email of the committer + * @param date + * the timestamp of the commit + * @return this deleter + */ + public GHContentDeleter committer(String name, String email, Instant date) { + req.with("committer", new UserInfo(name, email, date)); + return this; + } + + /** + * Sets the commit message. + * + * @param message + * the commit message + * @return this deleter + */ + public GHContentDeleter message(String message) { + req.with("message", message); + return this; + } +} diff --git a/src/main/java/org/kohsuke/github/GHContentUpdater.java b/src/main/java/org/kohsuke/github/GHContentUpdater.java new file mode 100644 index 0000000000..41111af339 --- /dev/null +++ b/src/main/java/org/kohsuke/github/GHContentUpdater.java @@ -0,0 +1,205 @@ +package org.kohsuke.github; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.time.Instant; +import java.util.Base64; +import java.util.Date; + +/** + * Builder for updating existing repository content with support for specifying author and committer information. + * + *

+ * Obtain an instance via {@link GHContent#createUpdate()}. + * + * @see GHContent#createUpdate() + */ +public final class GHContentUpdater { + @JsonInclude(Include.NON_NULL) + private static final class UserInfo { + private final String date; + private final String email; + private final String name; + + private UserInfo(String name, String email, Instant date) { + this.name = name; + this.email = email; + this.date = date != null ? GitHubClient.printInstant(date) : null; + } + } + + private final GHContent content; + private String encodedContent; + private final Requester req; + + GHContentUpdater(GHContent content) { + this.content = content; + final GHRepository repository = content.getOwner(); + this.req = repository.root() + .createRequest() + .method("PUT") + .with("path", content.getPath()) + .with("sha", content.getSha()); + } + + /** + * Configures the author of the commit. If not specified, the authenticated user is used as the author. + * + * @param name + * the name of the author + * @param email + * the email of the author + * @return this updater + */ + public GHContentUpdater author(String name, String email) { + return author(name, email, (Instant) null); + } + + /** + * Configures the author of the commit. If not specified, the authenticated user is used as the author. + * + * @param name + * the name of the author + * @param email + * the email of the author + * @param date + * the date of the authoring + * @return this updater + * @deprecated use {@link #author(String, String, Instant)} instead + */ + @Deprecated + public GHContentUpdater author(String name, String email, Date date) { + return author(name, email, GitHubClient.toInstantOrNull(date)); + } + + /** + * Configures the author of the commit. If not specified, the authenticated user is used as the author. + * + * @param name + * the name of the author + * @param email + * the email of the author + * @param date + * the timestamp for the authoring + * @return this updater + */ + public GHContentUpdater author(String name, String email, Instant date) { + req.with("author", new UserInfo(name, email, date)); + return this; + } + + /** + * Sets the branch to update the content on. + * + * @param branch + * the branch name + * @return this updater + */ + public GHContentUpdater branch(String branch) { + req.with("branch", branch); + return this; + } + + /** + * Commits the update. + * + * @return the response containing the updated content and commit information + * @throws IOException + * the io exception + */ + public GHContentUpdateResponse commit() throws IOException { + final GHRepository repository = content.getOwner(); + GHContentUpdateResponse response = req.withUrlPath(GHContent.getApiRoute(repository, content.getPath())) + .fetch(GHContentUpdateResponse.class); + + response.getContent().wrap(repository); + response.getCommit().wrapUp(repository); + + return response; + } + + /** + * Configures the committer of the commit. If not specified, the authenticated user is used as the committer. + * + * @param name + * the name of the committer + * @param email + * the email of the committer + * @return this updater + */ + public GHContentUpdater committer(String name, String email) { + return committer(name, email, (Instant) null); + } + + /** + * Configures the committer of the commit. If not specified, the authenticated user is used as the committer. + * + * @param name + * the name of the committer + * @param email + * the email of the committer + * @param date + * the date of the commit + * @return this updater + * @deprecated use {@link #committer(String, String, Instant)} instead + */ + @Deprecated + public GHContentUpdater committer(String name, String email, Date date) { + return committer(name, email, GitHubClient.toInstantOrNull(date)); + } + + /** + * Configures the committer of the commit. If not specified, the authenticated user is used as the committer. + * + * @param name + * the name of the committer + * @param email + * the email of the committer + * @param date + * the timestamp of the commit + * @return this updater + */ + public GHContentUpdater committer(String name, String email, Instant date) { + req.with("committer", new UserInfo(name, email, date)); + return this; + } + + /** + * Sets the new file content as a string. + * + * @param newContent + * the new content + * @return this updater + */ + public GHContentUpdater content(String newContent) { + return content(newContent.getBytes(StandardCharsets.UTF_8)); + } + + /** + * Sets the new file content as raw bytes. + * + * @param newContent + * the new content bytes + * @return this updater + */ + public GHContentUpdater content(byte[] newContent) { + this.encodedContent = Base64.getEncoder().encodeToString(newContent); + req.with("content", encodedContent); + return this; + } + + /** + * Sets the commit message. + * + * @param message + * the commit message + * @return this updater + */ + public GHContentUpdater message(String message) { + req.with("message", message); + return this; + } +} diff --git a/src/main/resources/META-INF/native-image/org.kohsuke/github-api/reflect-config.json b/src/main/resources/META-INF/native-image/org.kohsuke/github-api/reflect-config.json index 64e75a26cf..52af02a2a4 100644 --- a/src/main/resources/META-INF/native-image/org.kohsuke/github-api/reflect-config.json +++ b/src/main/resources/META-INF/native-image/org.kohsuke/github-api/reflect-config.json @@ -1844,6 +1844,51 @@ "allPublicClasses": true, "allDeclaredClasses": true }, + { + "name": "org.kohsuke.github.GHContentBuilder$UserInfo", + "allPublicFields": true, + "allDeclaredFields": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredMethods": true, + "allPublicClasses": true, + "allDeclaredClasses": true + }, + { + "name": "org.kohsuke.github.GHContentDeleter", + "allPublicFields": true, + "allDeclaredFields": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredMethods": true, + "allPublicClasses": true, + "allDeclaredClasses": true + }, + { + "name": "org.kohsuke.github.GHContentDeleter$UserInfo", + "allPublicFields": true, + "allDeclaredFields": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredMethods": true, + "allPublicClasses": true, + "allDeclaredClasses": true + }, { "name": "org.kohsuke.github.GHContentSearchBuilder", "allPublicFields": true, @@ -1889,6 +1934,36 @@ "allPublicClasses": true, "allDeclaredClasses": true }, + { + "name": "org.kohsuke.github.GHContentUpdater", + "allPublicFields": true, + "allDeclaredFields": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredMethods": true, + "allPublicClasses": true, + "allDeclaredClasses": true + }, + { + "name": "org.kohsuke.github.GHContentUpdater$UserInfo", + "allPublicFields": true, + "allDeclaredFields": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredConstructors": true, + "allPublicConstructors": true, + "allDeclaredConstructors": true, + "queryAllPublicMethods": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredMethods": true, + "allPublicClasses": true, + "allDeclaredClasses": true + }, { "name": "org.kohsuke.github.GHContentUpdateResponse", "allPublicFields": true, diff --git a/src/main/resources/META-INF/native-image/org.kohsuke/github-api/serialization-config.json b/src/main/resources/META-INF/native-image/org.kohsuke/github-api/serialization-config.json index 7edaf309ce..b4c8f92359 100644 --- a/src/main/resources/META-INF/native-image/org.kohsuke/github-api/serialization-config.json +++ b/src/main/resources/META-INF/native-image/org.kohsuke/github-api/serialization-config.json @@ -371,6 +371,15 @@ { "name": "org.kohsuke.github.GHContentBuilder" }, + { + "name": "org.kohsuke.github.GHContentBuilder$UserInfo" + }, + { + "name": "org.kohsuke.github.GHContentDeleter" + }, + { + "name": "org.kohsuke.github.GHContentDeleter$UserInfo" + }, { "name": "org.kohsuke.github.GHContentSearchBuilder" }, @@ -380,6 +389,12 @@ { "name": "org.kohsuke.github.GHContentSearchBuilder$Sort" }, + { + "name": "org.kohsuke.github.GHContentUpdater" + }, + { + "name": "org.kohsuke.github.GHContentUpdater$UserInfo" + }, { "name": "org.kohsuke.github.GHContentUpdateResponse" }, diff --git a/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java b/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java index 7c60131669..d310b8924b 100644 --- a/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java +++ b/src/test/java/org/kohsuke/github/GHContentIntegrationTest.java @@ -9,6 +9,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; +import java.util.Date; import java.util.List; import static org.hamcrest.Matchers.*; @@ -145,6 +146,108 @@ public void testCRUDContent() throws Exception { } } + /** + * Test creating content with custom author and committer via GHContentBuilder. + * + * @throws Exception + * the exception + */ + @Test + public void testCreateWithAuthorCommitter() throws Exception { + GHRepository ghRepository = getTempRepository(); + GHContentUpdateResponse response = ghRepository.createContent() + .message("Creating with custom author and committer") + .path("author-committer-test.md") + .content("test content\n") + .author("John Doe", "john@example.com") + .committer("Service Account", "service@example.com") + .commit(); + + assertThat(response.getContent(), notNullValue()); + assertThat(response.getCommit(), notNullValue()); + assertThat(response.getCommit().getAuthor().getName(), equalTo("John Doe")); + assertThat(response.getCommit().getAuthor().getEmail(), equalTo("john@example.com")); + assertThat(response.getCommit().getCommitter().getName(), equalTo("Service Account")); + assertThat(response.getCommit().getCommitter().getEmail(), equalTo("service@example.com")); + } + + /** + * Test creating content with custom author and committer with date via GHContentBuilder. + * + * @throws Exception + * the exception + */ + @SuppressWarnings("deprecation") + @Test + public void testCreateWithAuthorCommitterAndDate() throws Exception { + GHRepository ghRepository = getTempRepository(); + GHContentUpdateResponse response = ghRepository.createContent() + .message("Creating with custom author and committer") + .path("author-committer-test.md") + .content("test content\n") + .author("John Doe", "john@example.com", new Date(1234567890000L)) + .committer("Service Account", "service@example.com", new Date(1234567890000L)) + .commit(); + + assertThat(response.getContent(), notNullValue()); + assertThat(response.getCommit(), notNullValue()); + assertThat(response.getCommit().getAuthor().getName(), equalTo("John Doe")); + assertThat(response.getCommit().getAuthor().getEmail(), equalTo("john@example.com")); + assertThat(response.getCommit().getAuthoredDate(), equalTo(GitHubClient.parseInstant("2009-02-13T23:31:30Z"))); + assertThat(response.getCommit().getCommitter().getName(), equalTo("Service Account")); + assertThat(response.getCommit().getCommitter().getEmail(), equalTo("service@example.com")); + assertThat(response.getCommit().getCommitDate(), equalTo(GitHubClient.parseInstant("2009-02-13T23:31:30Z"))); + } + + /** + * Test deleting content with custom author and committer via GHContentDeleter. + * + * @throws Exception + * the exception + */ + @Test + public void testDeleteWithAuthorCommitter() throws Exception { + GHContent content = repo.getFileContent("ghcontent-ro/a-file-with-content"); + GHContentUpdateResponse response = content.createDelete() + .message("Deleting with custom author and committer") + .branch("main") + .author("John Doe", "john@example.com") + .committer("Service Account", "service@example.com") + .commit(); + + assertThat(response.getCommit(), notNullValue()); + assertThat(response.getCommit().getAuthor().getName(), equalTo("John Doe")); + assertThat(response.getCommit().getAuthor().getEmail(), equalTo("john@example.com")); + assertThat(response.getCommit().getCommitter().getName(), equalTo("Service Account")); + assertThat(response.getCommit().getCommitter().getEmail(), equalTo("service@example.com")); + } + + /** + * Test deleting content with custom author and committer with date via GHContentDeleter. + * + * @throws Exception + * the exception + */ + @SuppressWarnings("deprecation") + @Test + public void testDeleteWithAuthorCommitterAndDate() throws Exception { + GHContent content = repo.getFileContent("ghcontent-ro/a-file-with-content"); + GHContentUpdateResponse response = content.createDelete() + .message("Deleting with custom author and committer") + .branch("main") + .author("John Doe", "john@example.com", new Date(1234567890000L)) + .committer("Service Account", "service@example.com", new Date(1234567890000L)) + .commit(); + + assertThat(response.getCommit(), notNullValue()); + assertThat(response.getCommit().getAuthor().getName(), equalTo("John Doe")); + assertThat(response.getCommit().getAuthor().getEmail(), equalTo("john@example.com")); + assertThat(response.getCommit().getAuthoredDate(), equalTo(GitHubClient.parseInstant("2009-02-13T23:31:30Z"))); + assertThat(response.getCommit().getCommitter().getName(), equalTo("Service Account")); + assertThat(response.getCommit().getCommitter().getEmail(), equalTo("service@example.com")); + assertThat(response.getCommit().getCommitDate(), equalTo(GitHubClient.parseInstant("2009-02-13T23:31:30Z"))); + } + /** * Test get directory content. * @@ -320,6 +423,59 @@ public void testMIMESmall() throws IOException { ghContentBuilder.commit(); } + /** + * Test updating content with custom author and committer via GHContentUpdater. + * + * @throws Exception + * the exception + */ + @Test + public void testUpdateWithAuthorCommitter() throws Exception { + GHContent content = repo.getFileContent("ghcontent-ro/a-file-with-content"); + GHContentUpdateResponse response = content.createUpdate() + .content("updated content\n") + .message("Updating with custom author and committer") + .branch("main") + .author("John Doe", "john@example.com") + .committer("Service Account", "service@example.com") + .commit(); + + assertThat(response.getContent(), notNullValue()); + assertThat(response.getCommit(), notNullValue()); + assertThat(response.getCommit().getAuthor().getName(), equalTo("John Doe")); + assertThat(response.getCommit().getAuthor().getEmail(), equalTo("john@example.com")); + assertThat(response.getCommit().getCommitter().getName(), equalTo("Service Account")); + assertThat(response.getCommit().getCommitter().getEmail(), equalTo("service@example.com")); + } + + /** + * Test updating content with custom author and committer with date via GHContentUpdater. + * + * @throws Exception + * the exception + */ + @SuppressWarnings("deprecation") + @Test + public void testUpdateWithAuthorCommitterAndDate() throws Exception { + GHContent content = repo.getFileContent("ghcontent-ro/a-file-with-content"); + GHContentUpdateResponse response = content.createUpdate() + .content("updated content\n") + .message("Updating with custom author and committer") + .branch("main") + .author("John Doe", "john@example.com", new Date(1234567890000L)) + .committer("Service Account", "service@example.com", new Date(1234567890000L)) + .commit(); + + assertThat(response.getContent(), notNullValue()); + assertThat(response.getCommit(), notNullValue()); + assertThat(response.getCommit().getAuthor().getName(), equalTo("John Doe")); + assertThat(response.getCommit().getAuthor().getEmail(), equalTo("john@example.com")); + assertThat(response.getCommit().getAuthoredDate(), equalTo(GitHubClient.parseInstant("2009-02-13T23:31:30Z"))); + assertThat(response.getCommit().getCommitter().getName(), equalTo("Service Account")); + assertThat(response.getCommit().getCommitter().getEmail(), equalTo("service@example.com")); + assertThat(response.getCommit().getCommitDate(), equalTo(GitHubClient.parseInstant("2009-02-13T23:31:30Z"))); + } + /** * Check basic commit info. * diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/1-user.json new file mode 100644 index 0000000000..98e8c76ba2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/1-user.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 178, + "public_gists": 7, + "followers": 144, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-12-18T01:26:55Z", + "private_gists": 7, + "total_private_repos": 10, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..68e3d4f428 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,313 @@ +{ + "id": 40763577, + "node_id": "MDEwOlJlcG9zaXRvcnk0MDc2MzU3Nw==", + "name": "GHContentIntegrationTest", + "full_name": "hub4j-test-org/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/deployments", + "created_at": "2015-08-15T14:14:57Z", + "updated_at": "2019-11-26T01:09:49Z", + "pushed_at": "2019-11-26T01:09:48Z", + "git_url": "git://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHContentIntegrationTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "homepage": null, + "size": 52, + "stargazers_count": 1, + "watchers_count": 1, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 41, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 41, + "open_issues": 0, + "watchers": 1, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 19653852, + "node_id": "MDEwOlJlcG9zaXRvcnkxOTY1Mzg1Mg==", + "name": "GHContentIntegrationTest", + "full_name": "kohsuke2/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/deployments", + "created_at": "2014-05-10T22:50:30Z", + "updated_at": "2018-11-07T15:36:19Z", + "pushed_at": "2018-11-07T15:36:18Z", + "git_url": "git://github.com/kohsuke2/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:kohsuke2/GHContentIntegrationTest.git", + "clone_url": "https://github.com/kohsuke2/GHContentIntegrationTest.git", + "svn_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "homepage": null, + "size": 111, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 1, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "source": { + "id": 14779458, + "node_id": "MDEwOlJlcG9zaXRvcnkxNDc3OTQ1OA==", + "name": "github-api-test-1", + "full_name": "farmdawgnation/github-api-test-1", + "private": false, + "owner": { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/farmdawgnation/github-api-test-1", + "description": "Repository used for integration test of github-api", + "fork": false, + "url": "https://api.github.com/repos/farmdawgnation/github-api-test-1", + "forks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/forks", + "keys_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/teams", + "hooks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/hooks", + "issue_events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/events{/number}", + "events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/events", + "assignees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/assignees{/user}", + "branches_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/branches{/branch}", + "tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/tags", + "blobs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/statuses/{sha}", + "languages_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/languages", + "stargazers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/stargazers", + "contributors_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contributors", + "subscribers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscribers", + "subscription_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscription", + "commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contents/{+path}", + "compare_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/merges", + "archive_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/downloads", + "issues_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues{/number}", + "pulls_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/pulls{/number}", + "milestones_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/milestones{/number}", + "notifications_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/labels{/name}", + "releases_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/releases{/id}", + "deployments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/deployments", + "created_at": "2013-11-28T14:46:38Z", + "updated_at": "2016-02-05T13:33:23Z", + "pushed_at": "2013-11-28T14:55:36Z", + "git_url": "git://github.com/farmdawgnation/github-api-test-1.git", + "ssh_url": "git@github.com:farmdawgnation/github-api-test-1.git", + "clone_url": "https://github.com/farmdawgnation/github-api-test-1.git", + "svn_url": "https://github.com/farmdawgnation/github-api-test-1", + "homepage": null, + "size": 89, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 60, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 60, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "network_count": 60, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/3-r_h_temp-testCreateWithAuthorCommitter.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/3-r_h_temp-testCreateWithAuthorCommitter.json new file mode 100644 index 0000000000..afa1408145 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/3-r_h_temp-testCreateWithAuthorCommitter.json @@ -0,0 +1,71 @@ +{ + "id": 999000001, + "node_id": "MDEwOlJlcG9zaXRvcnk5OTkwMDAwMDE=", + "name": "temp-testCreateWithAuthorCommitter", + "full_name": "hub4j-test-org/temp-testCreateWithAuthorCommitter", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter", + "description": "A test repository for testing the github-api project: temp-testCreateWithAuthorCommitter", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter", + "contents_url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/contents/{+path}", + "created_at": "2024-01-01T00:00:00Z", + "updated_at": "2024-01-01T00:00:00Z", + "pushed_at": "2024-01-01T00:00:00Z", + "git_url": "git://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter.git", + "ssh_url": "git@github.com:hub4j-test-org/temp-testCreateWithAuthorCommitter.git", + "clone_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter.git", + "svn_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter", + "homepage": "http://github-api.kohsuke.org/", + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 1 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/4-r_h_t_contents_author-committer-testmd.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/4-r_h_t_contents_author-committer-testmd.json new file mode 100644 index 0000000000..d062b7b019 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/__files/4-r_h_t_contents_author-committer-testmd.json @@ -0,0 +1,52 @@ +{ + "content": { + "name": "author-committer-test.md", + "path": "author-committer-test.md", + "sha": "aabbccdd11223344556677889900aabbccddeeff", + "size": 13, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/contents/author-committer-test.md?ref=main", + "html_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/blob/main/author-committer-test.md", + "git_url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/blobs/aabbccdd11223344556677889900aabbccddeeff", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/main/author-committer-test.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/contents/author-committer-test.md?ref=main", + "git": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/blobs/aabbccdd11223344556677889900aabbccddeeff", + "html": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/blob/main/author-committer-test.md" + } + }, + "commit": { + "sha": "1122334455667788990011223344556677889900", + "node_id": "MDY6Q29tbWl0OTk5MDAwMDAxOjExMjIzMzQ0NTU2Njc3ODg5OTAwMTEyMjMzNDQ1NTY2Nzc4ODk5MDA=", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/commits/1122334455667788990011223344556677889900", + "html_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/commit/1122334455667788990011223344556677889900", + "author": { + "name": "John Doe", + "email": "john@example.com", + "date": "2024-01-01T00:00:00Z" + }, + "committer": { + "name": "Service Account", + "email": "service@example.com", + "date": "2024-01-01T00:00:00Z" + }, + "tree": { + "sha": "aabb00112233445566778899aabb00112233ccdd", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/trees/aabb00112233445566778899aabb00112233ccdd" + }, + "message": "Creating with custom author and committer", + "parents": [ + { + "sha": "0000111122223333444455556666777788889999", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/commits/0000111122223333444455556666777788889999", + "html_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/commit/0000111122223333444455556666777788889999" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/1-user.json new file mode 100644 index 0000000000..867e80d5f8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/1-user.json @@ -0,0 +1,48 @@ +{ + "id": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "1-user.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"be4370b3c906450f450e411f567ee839\"", + "Last-Modified": "Wed, 18 Dec 2019 01:26:55 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C05:B32660:5DFD9463" + } + }, + "uuid": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..a96af5128d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,48 @@ +{ + "id": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "name": "repos_hub4j-test-org_ghcontentintegrationtest", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "2-r_h_ghcontentintegrationtest.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"1e430d4199aa33f3d4673fee6fee2709\"", + "Last-Modified": "Tue, 26 Nov 2019 01:09:49 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C3A:B32669:5DFD9463" + } + }, + "uuid": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/3-r_h_temp-testCreateWithAuthorCommitter.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/3-r_h_temp-testCreateWithAuthorCommitter.json new file mode 100644 index 0000000000..3786f6f96f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/3-r_h_temp-testCreateWithAuthorCommitter.json @@ -0,0 +1,24 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-100000000001", + "name": "repos_hub4j-test-org_temp-testCreateWithAuthorCommitter", + "request": { + "url": "/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "3-r_h_temp-testCreateWithAuthorCommitter.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-100000000001", + "persistent": true, + "insertionIndex": 3 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/4-r_h_t_contents_author-committer-testmd.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/4-r_h_t_contents_author-committer-testmd.json new file mode 100644 index 0000000000..8088c308a8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitter/mappings/4-r_h_t_contents_author-committer-testmd.json @@ -0,0 +1,31 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-100000000002", + "name": "repos_hub4j-test-org_temp-testCreateWithAuthorCommitter_contents_author-committer-testmd", + "request": { + "url": "/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/contents/author-committer-test.md", + "method": "PUT", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"path\":\"author-committer-test.md\",\"message\":\"Creating with custom author and committer\",\"content\":\"dGVzdCBjb250ZW50Cg==\",\"author\":{\"name\":\"John Doe\",\"email\":\"john@example.com\"},\"committer\":{\"name\":\"Service Account\",\"email\":\"service@example.com\"}}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "4-r_h_t_contents_author-committer-testmd.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "201 Created" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-100000000002", + "persistent": true, + "insertionIndex": 4 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/1-user.json new file mode 100644 index 0000000000..98e8c76ba2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/1-user.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 178, + "public_gists": 7, + "followers": 144, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-12-18T01:26:55Z", + "private_gists": 7, + "total_private_repos": 10, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..68e3d4f428 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,313 @@ +{ + "id": 40763577, + "node_id": "MDEwOlJlcG9zaXRvcnk0MDc2MzU3Nw==", + "name": "GHContentIntegrationTest", + "full_name": "hub4j-test-org/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/deployments", + "created_at": "2015-08-15T14:14:57Z", + "updated_at": "2019-11-26T01:09:49Z", + "pushed_at": "2019-11-26T01:09:48Z", + "git_url": "git://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHContentIntegrationTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "homepage": null, + "size": 52, + "stargazers_count": 1, + "watchers_count": 1, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 41, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 41, + "open_issues": 0, + "watchers": 1, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 19653852, + "node_id": "MDEwOlJlcG9zaXRvcnkxOTY1Mzg1Mg==", + "name": "GHContentIntegrationTest", + "full_name": "kohsuke2/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/deployments", + "created_at": "2014-05-10T22:50:30Z", + "updated_at": "2018-11-07T15:36:19Z", + "pushed_at": "2018-11-07T15:36:18Z", + "git_url": "git://github.com/kohsuke2/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:kohsuke2/GHContentIntegrationTest.git", + "clone_url": "https://github.com/kohsuke2/GHContentIntegrationTest.git", + "svn_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "homepage": null, + "size": 111, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 1, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "source": { + "id": 14779458, + "node_id": "MDEwOlJlcG9zaXRvcnkxNDc3OTQ1OA==", + "name": "github-api-test-1", + "full_name": "farmdawgnation/github-api-test-1", + "private": false, + "owner": { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/farmdawgnation/github-api-test-1", + "description": "Repository used for integration test of github-api", + "fork": false, + "url": "https://api.github.com/repos/farmdawgnation/github-api-test-1", + "forks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/forks", + "keys_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/teams", + "hooks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/hooks", + "issue_events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/events{/number}", + "events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/events", + "assignees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/assignees{/user}", + "branches_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/branches{/branch}", + "tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/tags", + "blobs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/statuses/{sha}", + "languages_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/languages", + "stargazers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/stargazers", + "contributors_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contributors", + "subscribers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscribers", + "subscription_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscription", + "commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contents/{+path}", + "compare_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/merges", + "archive_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/downloads", + "issues_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues{/number}", + "pulls_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/pulls{/number}", + "milestones_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/milestones{/number}", + "notifications_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/labels{/name}", + "releases_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/releases{/id}", + "deployments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/deployments", + "created_at": "2013-11-28T14:46:38Z", + "updated_at": "2016-02-05T13:33:23Z", + "pushed_at": "2013-11-28T14:55:36Z", + "git_url": "git://github.com/farmdawgnation/github-api-test-1.git", + "ssh_url": "git@github.com:farmdawgnation/github-api-test-1.git", + "clone_url": "https://github.com/farmdawgnation/github-api-test-1.git", + "svn_url": "https://github.com/farmdawgnation/github-api-test-1", + "homepage": null, + "size": 89, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 60, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 60, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "network_count": 60, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/3-r_h_temp-testCreateWithAuthorCommitterAndDate.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/3-r_h_temp-testCreateWithAuthorCommitterAndDate.json new file mode 100644 index 0000000000..09e91125cd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/3-r_h_temp-testCreateWithAuthorCommitterAndDate.json @@ -0,0 +1,71 @@ +{ + "id": 999000001, + "node_id": "MDEwOlJlcG9zaXRvcnk5OTkwMDAwMDE=", + "name": "temp-testCreateWithAuthorCommitterAndDate", + "full_name": "hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate", + "description": "A test repository for testing the github-api project: temp-testCreateWithAuthorCommitterAndDate", + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate", + "contents_url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate/contents/{+path}", + "created_at": "2024-01-01T00:00:00Z", + "updated_at": "2024-01-01T00:00:00Z", + "pushed_at": "2024-01-01T00:00:00Z", + "git_url": "git://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate.git", + "ssh_url": "git@github.com:hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate.git", + "clone_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate.git", + "svn_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate", + "homepage": "http://github-api.kohsuke.org/", + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "type": "Organization", + "site_admin": false + }, + "network_count": 0, + "subscribers_count": 1 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/4-r_h_t_contents_author-committer-testmd.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/4-r_h_t_contents_author-committer-testmd.json new file mode 100644 index 0000000000..25d2ad11f3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/__files/4-r_h_t_contents_author-committer-testmd.json @@ -0,0 +1,52 @@ +{ + "content": { + "name": "author-committer-test.md", + "path": "author-committer-test.md", + "sha": "aabbccdd11223344556677889900aabbccddeeff", + "size": 13, + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/contents/author-committer-test.md?ref=main", + "html_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/blob/main/author-committer-test.md", + "git_url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/blobs/aabbccdd11223344556677889900aabbccddeeff", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/main/author-committer-test.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/contents/author-committer-test.md?ref=main", + "git": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/blobs/aabbccdd11223344556677889900aabbccddeeff", + "html": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/blob/main/author-committer-test.md" + } + }, + "commit": { + "sha": "1122334455667788990011223344556677889900", + "node_id": "MDY6Q29tbWl0OTk5MDAwMDAxOjExMjIzMzQ0NTU2Njc3ODg5OTAwMTEyMjMzNDQ1NTY2Nzc4ODk5MDA=", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/commits/1122334455667788990011223344556677889900", + "html_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/commit/1122334455667788990011223344556677889900", + "author": { + "name": "John Doe", + "email": "john@example.com", + "date": "2009-02-13T23:31:30Z" + }, + "committer": { + "name": "Service Account", + "email": "service@example.com", + "date": "2009-02-13T23:31:30Z" + }, + "tree": { + "sha": "aabb00112233445566778899aabb00112233ccdd", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/trees/aabb00112233445566778899aabb00112233ccdd" + }, + "message": "Creating with custom author and committer", + "parents": [ + { + "sha": "0000111122223333444455556666777788889999", + "url": "https://api.github.com/repos/hub4j-test-org/temp-testCreateWithAuthorCommitter/git/commits/0000111122223333444455556666777788889999", + "html_url": "https://github.com/hub4j-test-org/temp-testCreateWithAuthorCommitter/commit/0000111122223333444455556666777788889999" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/1-user.json new file mode 100644 index 0000000000..867e80d5f8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/1-user.json @@ -0,0 +1,48 @@ +{ + "id": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "1-user.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"be4370b3c906450f450e411f567ee839\"", + "Last-Modified": "Wed, 18 Dec 2019 01:26:55 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C05:B32660:5DFD9463" + } + }, + "uuid": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..a96af5128d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,48 @@ +{ + "id": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "name": "repos_hub4j-test-org_ghcontentintegrationtest", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "2-r_h_ghcontentintegrationtest.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"1e430d4199aa33f3d4673fee6fee2709\"", + "Last-Modified": "Tue, 26 Nov 2019 01:09:49 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C3A:B32669:5DFD9463" + } + }, + "uuid": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/3-r_h_temp-testCreateWithAuthorCommitterAndDate.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/3-r_h_temp-testCreateWithAuthorCommitterAndDate.json new file mode 100644 index 0000000000..5935e09809 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/3-r_h_temp-testCreateWithAuthorCommitterAndDate.json @@ -0,0 +1,24 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-110000000001", + "name": "repos_hub4j-test-org_temp-testCreateWithAuthorCommitterAndDate", + "request": { + "url": "/repos/hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "3-r_h_temp-testCreateWithAuthorCommitterAndDate.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-110000000001", + "persistent": true, + "insertionIndex": 3 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/4-r_h_t_contents_author-committer-testmd.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/4-r_h_t_contents_author-committer-testmd.json new file mode 100644 index 0000000000..a858d2cef4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testCreateWithAuthorCommitterAndDate/mappings/4-r_h_t_contents_author-committer-testmd.json @@ -0,0 +1,31 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-110000000002", + "name": "repos_hub4j-test-org_temp-testCreateWithAuthorCommitterAndDate_contents_author-committer-testmd", + "request": { + "url": "/repos/hub4j-test-org/temp-testCreateWithAuthorCommitterAndDate/contents/author-committer-test.md", + "method": "PUT", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"path\":\"author-committer-test.md\",\"message\":\"Creating with custom author and committer\",\"content\":\"dGVzdCBjb250ZW50Cg==\",\"author\":{\"name\":\"John Doe\",\"email\":\"john@example.com\",\"date\":\"2009-02-13T23:31:30Z\"},\"committer\":{\"name\":\"Service Account\",\"email\":\"service@example.com\",\"date\":\"2009-02-13T23:31:30Z\"}}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "4-r_h_t_contents_author-committer-testmd.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "201 Created" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-110000000002", + "persistent": true, + "insertionIndex": 4 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/1-user.json new file mode 100644 index 0000000000..98e8c76ba2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/1-user.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 178, + "public_gists": 7, + "followers": 144, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-12-18T01:26:55Z", + "private_gists": 7, + "total_private_repos": 10, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..68e3d4f428 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,313 @@ +{ + "id": 40763577, + "node_id": "MDEwOlJlcG9zaXRvcnk0MDc2MzU3Nw==", + "name": "GHContentIntegrationTest", + "full_name": "hub4j-test-org/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/deployments", + "created_at": "2015-08-15T14:14:57Z", + "updated_at": "2019-11-26T01:09:49Z", + "pushed_at": "2019-11-26T01:09:48Z", + "git_url": "git://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHContentIntegrationTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "homepage": null, + "size": 52, + "stargazers_count": 1, + "watchers_count": 1, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 41, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 41, + "open_issues": 0, + "watchers": 1, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 19653852, + "node_id": "MDEwOlJlcG9zaXRvcnkxOTY1Mzg1Mg==", + "name": "GHContentIntegrationTest", + "full_name": "kohsuke2/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/deployments", + "created_at": "2014-05-10T22:50:30Z", + "updated_at": "2018-11-07T15:36:19Z", + "pushed_at": "2018-11-07T15:36:18Z", + "git_url": "git://github.com/kohsuke2/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:kohsuke2/GHContentIntegrationTest.git", + "clone_url": "https://github.com/kohsuke2/GHContentIntegrationTest.git", + "svn_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "homepage": null, + "size": 111, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 1, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "source": { + "id": 14779458, + "node_id": "MDEwOlJlcG9zaXRvcnkxNDc3OTQ1OA==", + "name": "github-api-test-1", + "full_name": "farmdawgnation/github-api-test-1", + "private": false, + "owner": { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/farmdawgnation/github-api-test-1", + "description": "Repository used for integration test of github-api", + "fork": false, + "url": "https://api.github.com/repos/farmdawgnation/github-api-test-1", + "forks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/forks", + "keys_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/teams", + "hooks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/hooks", + "issue_events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/events{/number}", + "events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/events", + "assignees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/assignees{/user}", + "branches_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/branches{/branch}", + "tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/tags", + "blobs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/statuses/{sha}", + "languages_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/languages", + "stargazers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/stargazers", + "contributors_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contributors", + "subscribers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscribers", + "subscription_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscription", + "commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contents/{+path}", + "compare_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/merges", + "archive_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/downloads", + "issues_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues{/number}", + "pulls_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/pulls{/number}", + "milestones_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/milestones{/number}", + "notifications_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/labels{/name}", + "releases_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/releases{/id}", + "deployments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/deployments", + "created_at": "2013-11-28T14:46:38Z", + "updated_at": "2016-02-05T13:33:23Z", + "pushed_at": "2013-11-28T14:55:36Z", + "git_url": "git://github.com/farmdawgnation/github-api-test-1.git", + "ssh_url": "git@github.com:farmdawgnation/github-api-test-1.git", + "clone_url": "https://github.com/farmdawgnation/github-api-test-1.git", + "svn_url": "https://github.com/farmdawgnation/github-api-test-1", + "homepage": null, + "size": 89, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 60, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 60, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "network_count": 60, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json new file mode 100644 index 0000000000..b2bf0b6737 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json @@ -0,0 +1,18 @@ +{ + "name": "a-file-with-content", + "path": "ghcontent-ro/a-file-with-content", + "sha": "901fd87750a8e53fe39a219cad50d4f7c80ca272", + "size": 22, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content", + "git_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/901fd87750a8e53fe39a219cad50d4f7c80ca272", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/GHContentIntegrationTest/main/ghcontent-ro/a-file-with-content", + "type": "file", + "content": "dGhhbmtzIGZvciByZWFkaW5nIG1lCg==\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "git": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/901fd87750a8e53fe39a219cad50d4f7c80ca272", + "html": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json new file mode 100644 index 0000000000..ffebfc933f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json @@ -0,0 +1,37 @@ +{ + "content": null, + "commit": { + "sha": "3344556677889900112233445566778899001122", + "node_id": "MDY6Q29tbWl0NDA3NjM1Nzc6MzM0NDU1NjY3Nzg4OTkwMDExMjIzMzQ0NTU2Njc3ODg5OTAwMTEyMg==", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits/3344556677889900112233445566778899001122", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/commit/3344556677889900112233445566778899001122", + "author": { + "name": "John Doe", + "email": "john@example.com", + "date": "2024-01-01T00:00:00Z" + }, + "committer": { + "name": "Service Account", + "email": "service@example.com", + "date": "2024-01-01T00:00:00Z" + }, + "tree": { + "sha": "eeff00112233445566778899aabb00112233ddee", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees/eeff00112233445566778899aabb00112233ddee" + }, + "message": "Deleting with custom author and committer", + "parents": [ + { + "sha": "bbbb111122223333444455556666777788889999", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits/bbbb111122223333444455556666777788889999", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/commit/bbbb111122223333444455556666777788889999" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/1-user.json new file mode 100644 index 0000000000..867e80d5f8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/1-user.json @@ -0,0 +1,48 @@ +{ + "id": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "1-user.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"be4370b3c906450f450e411f567ee839\"", + "Last-Modified": "Wed, 18 Dec 2019 01:26:55 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C05:B32660:5DFD9463" + } + }, + "uuid": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..a96af5128d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,48 @@ +{ + "id": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "name": "repos_hub4j-test-org_ghcontentintegrationtest", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "2-r_h_ghcontentintegrationtest.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"1e430d4199aa33f3d4673fee6fee2709\"", + "Last-Modified": "Tue, 26 Nov 2019 01:09:49 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C3A:B32669:5DFD9463" + } + }, + "uuid": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json new file mode 100644 index 0000000000..c661ffe5cb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json @@ -0,0 +1,24 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-300000000001", + "name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-file-with-content", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "3-r_h_g_contents_ghcontent-ro_a-file-with-content.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-300000000001", + "persistent": true, + "insertionIndex": 3 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json new file mode 100644 index 0000000000..c6cfc36ccf --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitter/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json @@ -0,0 +1,31 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-300000000002", + "name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-file-with-content_delete", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"path\":\"ghcontent-ro/a-file-with-content\",\"sha\":\"901fd87750a8e53fe39a219cad50d4f7c80ca272\",\"message\":\"Deleting with custom author and committer\",\"branch\":\"main\",\"author\":{\"name\":\"John Doe\",\"email\":\"john@example.com\"},\"committer\":{\"name\":\"Service Account\",\"email\":\"service@example.com\"}}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-300000000002", + "persistent": true, + "insertionIndex": 4 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/1-user.json new file mode 100644 index 0000000000..98e8c76ba2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/1-user.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 178, + "public_gists": 7, + "followers": 144, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-12-18T01:26:55Z", + "private_gists": 7, + "total_private_repos": 10, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..68e3d4f428 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,313 @@ +{ + "id": 40763577, + "node_id": "MDEwOlJlcG9zaXRvcnk0MDc2MzU3Nw==", + "name": "GHContentIntegrationTest", + "full_name": "hub4j-test-org/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/deployments", + "created_at": "2015-08-15T14:14:57Z", + "updated_at": "2019-11-26T01:09:49Z", + "pushed_at": "2019-11-26T01:09:48Z", + "git_url": "git://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHContentIntegrationTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "homepage": null, + "size": 52, + "stargazers_count": 1, + "watchers_count": 1, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 41, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 41, + "open_issues": 0, + "watchers": 1, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 19653852, + "node_id": "MDEwOlJlcG9zaXRvcnkxOTY1Mzg1Mg==", + "name": "GHContentIntegrationTest", + "full_name": "kohsuke2/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/deployments", + "created_at": "2014-05-10T22:50:30Z", + "updated_at": "2018-11-07T15:36:19Z", + "pushed_at": "2018-11-07T15:36:18Z", + "git_url": "git://github.com/kohsuke2/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:kohsuke2/GHContentIntegrationTest.git", + "clone_url": "https://github.com/kohsuke2/GHContentIntegrationTest.git", + "svn_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "homepage": null, + "size": 111, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 1, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "source": { + "id": 14779458, + "node_id": "MDEwOlJlcG9zaXRvcnkxNDc3OTQ1OA==", + "name": "github-api-test-1", + "full_name": "farmdawgnation/github-api-test-1", + "private": false, + "owner": { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/farmdawgnation/github-api-test-1", + "description": "Repository used for integration test of github-api", + "fork": false, + "url": "https://api.github.com/repos/farmdawgnation/github-api-test-1", + "forks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/forks", + "keys_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/teams", + "hooks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/hooks", + "issue_events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/events{/number}", + "events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/events", + "assignees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/assignees{/user}", + "branches_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/branches{/branch}", + "tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/tags", + "blobs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/statuses/{sha}", + "languages_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/languages", + "stargazers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/stargazers", + "contributors_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contributors", + "subscribers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscribers", + "subscription_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscription", + "commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contents/{+path}", + "compare_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/merges", + "archive_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/downloads", + "issues_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues{/number}", + "pulls_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/pulls{/number}", + "milestones_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/milestones{/number}", + "notifications_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/labels{/name}", + "releases_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/releases{/id}", + "deployments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/deployments", + "created_at": "2013-11-28T14:46:38Z", + "updated_at": "2016-02-05T13:33:23Z", + "pushed_at": "2013-11-28T14:55:36Z", + "git_url": "git://github.com/farmdawgnation/github-api-test-1.git", + "ssh_url": "git@github.com:farmdawgnation/github-api-test-1.git", + "clone_url": "https://github.com/farmdawgnation/github-api-test-1.git", + "svn_url": "https://github.com/farmdawgnation/github-api-test-1", + "homepage": null, + "size": 89, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 60, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 60, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "network_count": 60, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json new file mode 100644 index 0000000000..b2bf0b6737 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json @@ -0,0 +1,18 @@ +{ + "name": "a-file-with-content", + "path": "ghcontent-ro/a-file-with-content", + "sha": "901fd87750a8e53fe39a219cad50d4f7c80ca272", + "size": 22, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content", + "git_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/901fd87750a8e53fe39a219cad50d4f7c80ca272", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/GHContentIntegrationTest/main/ghcontent-ro/a-file-with-content", + "type": "file", + "content": "dGhhbmtzIGZvciByZWFkaW5nIG1lCg==\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "git": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/901fd87750a8e53fe39a219cad50d4f7c80ca272", + "html": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json new file mode 100644 index 0000000000..0498efff56 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json @@ -0,0 +1,37 @@ +{ + "content": null, + "commit": { + "sha": "3344556677889900112233445566778899001122", + "node_id": "MDY6Q29tbWl0NDA3NjM1Nzc6MzM0NDU1NjY3Nzg4OTkwMDExMjIzMzQ0NTU2Njc3ODg5OTAwMTEyMg==", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits/3344556677889900112233445566778899001122", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/commit/3344556677889900112233445566778899001122", + "author": { + "name": "John Doe", + "email": "john@example.com", + "date": "2009-02-13T23:31:30Z" + }, + "committer": { + "name": "Service Account", + "email": "service@example.com", + "date": "2009-02-13T23:31:30Z" + }, + "tree": { + "sha": "eeff00112233445566778899aabb00112233ddee", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees/eeff00112233445566778899aabb00112233ddee" + }, + "message": "Deleting with custom author and committer", + "parents": [ + { + "sha": "bbbb111122223333444455556666777788889999", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits/bbbb111122223333444455556666777788889999", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/commit/bbbb111122223333444455556666777788889999" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/1-user.json new file mode 100644 index 0000000000..867e80d5f8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/1-user.json @@ -0,0 +1,48 @@ +{ + "id": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "1-user.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"be4370b3c906450f450e411f567ee839\"", + "Last-Modified": "Wed, 18 Dec 2019 01:26:55 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C05:B32660:5DFD9463" + } + }, + "uuid": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..a96af5128d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,48 @@ +{ + "id": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "name": "repos_hub4j-test-org_ghcontentintegrationtest", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "2-r_h_ghcontentintegrationtest.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"1e430d4199aa33f3d4673fee6fee2709\"", + "Last-Modified": "Tue, 26 Nov 2019 01:09:49 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C3A:B32669:5DFD9463" + } + }, + "uuid": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json new file mode 100644 index 0000000000..c661ffe5cb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json @@ -0,0 +1,24 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-300000000001", + "name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-file-with-content", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "3-r_h_g_contents_ghcontent-ro_a-file-with-content.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-300000000001", + "persistent": true, + "insertionIndex": 3 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json new file mode 100644 index 0000000000..13cbaf6c73 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testDeleteWithAuthorCommitterAndDate/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json @@ -0,0 +1,31 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-310000000002", + "name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-file-with-content_delete_with_date", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"path\":\"ghcontent-ro/a-file-with-content\",\"sha\":\"901fd87750a8e53fe39a219cad50d4f7c80ca272\",\"message\":\"Deleting with custom author and committer\",\"branch\":\"main\",\"author\":{\"name\":\"John Doe\",\"email\":\"john@example.com\",\"date\":\"2009-02-13T23:31:30Z\"},\"committer\":{\"name\":\"Service Account\",\"email\":\"service@example.com\",\"date\":\"2009-02-13T23:31:30Z\"}}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "4-r_h_g_contents_ghcontent-ro_a-file-with-content-delete.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-310000000002", + "persistent": true, + "insertionIndex": 4 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/1-user.json new file mode 100644 index 0000000000..98e8c76ba2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/1-user.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 178, + "public_gists": 7, + "followers": 144, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-12-18T01:26:55Z", + "private_gists": 7, + "total_private_repos": 10, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..68e3d4f428 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,313 @@ +{ + "id": 40763577, + "node_id": "MDEwOlJlcG9zaXRvcnk0MDc2MzU3Nw==", + "name": "GHContentIntegrationTest", + "full_name": "hub4j-test-org/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/deployments", + "created_at": "2015-08-15T14:14:57Z", + "updated_at": "2019-11-26T01:09:49Z", + "pushed_at": "2019-11-26T01:09:48Z", + "git_url": "git://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHContentIntegrationTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "homepage": null, + "size": 52, + "stargazers_count": 1, + "watchers_count": 1, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 41, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 41, + "open_issues": 0, + "watchers": 1, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 19653852, + "node_id": "MDEwOlJlcG9zaXRvcnkxOTY1Mzg1Mg==", + "name": "GHContentIntegrationTest", + "full_name": "kohsuke2/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/deployments", + "created_at": "2014-05-10T22:50:30Z", + "updated_at": "2018-11-07T15:36:19Z", + "pushed_at": "2018-11-07T15:36:18Z", + "git_url": "git://github.com/kohsuke2/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:kohsuke2/GHContentIntegrationTest.git", + "clone_url": "https://github.com/kohsuke2/GHContentIntegrationTest.git", + "svn_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "homepage": null, + "size": 111, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 1, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "source": { + "id": 14779458, + "node_id": "MDEwOlJlcG9zaXRvcnkxNDc3OTQ1OA==", + "name": "github-api-test-1", + "full_name": "farmdawgnation/github-api-test-1", + "private": false, + "owner": { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/farmdawgnation/github-api-test-1", + "description": "Repository used for integration test of github-api", + "fork": false, + "url": "https://api.github.com/repos/farmdawgnation/github-api-test-1", + "forks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/forks", + "keys_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/teams", + "hooks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/hooks", + "issue_events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/events{/number}", + "events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/events", + "assignees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/assignees{/user}", + "branches_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/branches{/branch}", + "tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/tags", + "blobs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/statuses/{sha}", + "languages_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/languages", + "stargazers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/stargazers", + "contributors_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contributors", + "subscribers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscribers", + "subscription_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscription", + "commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contents/{+path}", + "compare_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/merges", + "archive_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/downloads", + "issues_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues{/number}", + "pulls_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/pulls{/number}", + "milestones_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/milestones{/number}", + "notifications_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/labels{/name}", + "releases_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/releases{/id}", + "deployments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/deployments", + "created_at": "2013-11-28T14:46:38Z", + "updated_at": "2016-02-05T13:33:23Z", + "pushed_at": "2013-11-28T14:55:36Z", + "git_url": "git://github.com/farmdawgnation/github-api-test-1.git", + "ssh_url": "git@github.com:farmdawgnation/github-api-test-1.git", + "clone_url": "https://github.com/farmdawgnation/github-api-test-1.git", + "svn_url": "https://github.com/farmdawgnation/github-api-test-1", + "homepage": null, + "size": 89, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 60, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 60, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "network_count": 60, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json new file mode 100644 index 0000000000..b2bf0b6737 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json @@ -0,0 +1,18 @@ +{ + "name": "a-file-with-content", + "path": "ghcontent-ro/a-file-with-content", + "sha": "901fd87750a8e53fe39a219cad50d4f7c80ca272", + "size": 22, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content", + "git_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/901fd87750a8e53fe39a219cad50d4f7c80ca272", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/GHContentIntegrationTest/main/ghcontent-ro/a-file-with-content", + "type": "file", + "content": "dGhhbmtzIGZvciByZWFkaW5nIG1lCg==\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "git": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/901fd87750a8e53fe39a219cad50d4f7c80ca272", + "html": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json new file mode 100644 index 0000000000..cd35c418e7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json @@ -0,0 +1,52 @@ +{ + "content": { + "name": "a-file-with-content", + "path": "ghcontent-ro/a-file-with-content", + "sha": "bbccddee11223344556677889900aabbccddeeff", + "size": 16, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content", + "git_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/bbccddee11223344556677889900aabbccddeeff", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/GHContentIntegrationTest/main/ghcontent-ro/a-file-with-content", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "git": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/bbccddee11223344556677889900aabbccddeeff", + "html": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content" + } + }, + "commit": { + "sha": "2233445566778899001122334455667788990011", + "node_id": "MDY6Q29tbWl0NDA3NjM1Nzc6MjIzMzQ0NTU2Njc3ODg5OTAwMTEyMjMzNDQ1NTY2Nzc4ODk5MDAxMQ==", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits/2233445566778899001122334455667788990011", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/commit/2233445566778899001122334455667788990011", + "author": { + "name": "John Doe", + "email": "john@example.com", + "date": "2024-01-01T00:00:00Z" + }, + "committer": { + "name": "Service Account", + "email": "service@example.com", + "date": "2024-01-01T00:00:00Z" + }, + "tree": { + "sha": "ccdd00112233445566778899aabb00112233eeff", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees/ccdd00112233445566778899aabb00112233eeff" + }, + "message": "Updating with custom author and committer", + "parents": [ + { + "sha": "aaaa111122223333444455556666777788889999", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits/aaaa111122223333444455556666777788889999", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/commit/aaaa111122223333444455556666777788889999" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/1-user.json new file mode 100644 index 0000000000..867e80d5f8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/1-user.json @@ -0,0 +1,48 @@ +{ + "id": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "1-user.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"be4370b3c906450f450e411f567ee839\"", + "Last-Modified": "Wed, 18 Dec 2019 01:26:55 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C05:B32660:5DFD9463" + } + }, + "uuid": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..a96af5128d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,48 @@ +{ + "id": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "name": "repos_hub4j-test-org_ghcontentintegrationtest", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "2-r_h_ghcontentintegrationtest.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"1e430d4199aa33f3d4673fee6fee2709\"", + "Last-Modified": "Tue, 26 Nov 2019 01:09:49 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C3A:B32669:5DFD9463" + } + }, + "uuid": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json new file mode 100644 index 0000000000..6191da8eb7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json @@ -0,0 +1,24 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-200000000001", + "name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-file-with-content", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "3-r_h_g_contents_ghcontent-ro_a-file-with-content.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-200000000001", + "persistent": true, + "insertionIndex": 3 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json new file mode 100644 index 0000000000..7a06d27795 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitter/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json @@ -0,0 +1,31 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-200000000002", + "name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-file-with-content_update", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content", + "method": "PUT", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"path\":\"ghcontent-ro/a-file-with-content\",\"sha\":\"901fd87750a8e53fe39a219cad50d4f7c80ca272\",\"message\":\"Updating with custom author and committer\",\"content\":\"dXBkYXRlZCBjb250ZW50Cg==\",\"branch\":\"main\",\"author\":{\"name\":\"John Doe\",\"email\":\"john@example.com\"},\"committer\":{\"name\":\"Service Account\",\"email\":\"service@example.com\"}}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-200000000002", + "persistent": true, + "insertionIndex": 4 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/1-user.json new file mode 100644 index 0000000000..98e8c76ba2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/1-user.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 178, + "public_gists": 7, + "followers": 144, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-12-18T01:26:55Z", + "private_gists": 7, + "total_private_repos": 10, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..68e3d4f428 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,313 @@ +{ + "id": 40763577, + "node_id": "MDEwOlJlcG9zaXRvcnk0MDc2MzU3Nw==", + "name": "GHContentIntegrationTest", + "full_name": "hub4j-test-org/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/deployments", + "created_at": "2015-08-15T14:14:57Z", + "updated_at": "2019-11-26T01:09:49Z", + "pushed_at": "2019-11-26T01:09:48Z", + "git_url": "git://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:hub4j-test-org/GHContentIntegrationTest.git", + "clone_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest.git", + "svn_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest", + "homepage": null, + "size": 52, + "stargazers_count": 1, + "watchers_count": 1, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 41, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 41, + "open_issues": 0, + "watchers": 1, + "default_branch": "main", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/hub4j-test-org", + "html_url": "https://github.com/hub4j-test-org", + "followers_url": "https://api.github.com/users/hub4j-test-org/followers", + "following_url": "https://api.github.com/users/hub4j-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/hub4j-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/hub4j-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/hub4j-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/hub4j-test-org/orgs", + "repos_url": "https://api.github.com/users/hub4j-test-org/repos", + "events_url": "https://api.github.com/users/hub4j-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/hub4j-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 19653852, + "node_id": "MDEwOlJlcG9zaXRvcnkxOTY1Mzg1Mg==", + "name": "GHContentIntegrationTest", + "full_name": "kohsuke2/GHContentIntegrationTest", + "private": false, + "owner": { + "login": "kohsuke2", + "id": 1329242, + "node_id": "MDQ6VXNlcjEzMjkyNDI=", + "avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/kohsuke2", + "html_url": "https://github.com/kohsuke2", + "followers_url": "https://api.github.com/users/kohsuke2/followers", + "following_url": "https://api.github.com/users/kohsuke2/following{/other_user}", + "gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}", + "starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions", + "organizations_url": "https://api.github.com/users/kohsuke2/orgs", + "repos_url": "https://api.github.com/users/kohsuke2/repos", + "events_url": "https://api.github.com/users/kohsuke2/events{/privacy}", + "received_events_url": "https://api.github.com/users/kohsuke2/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "description": "Repository used for integration test of github-api", + "fork": true, + "url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest", + "forks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/forks", + "keys_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/teams", + "hooks_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/hooks", + "issue_events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/events{/number}", + "events_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/events", + "assignees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/assignees{/user}", + "branches_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/branches{/branch}", + "tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/tags", + "blobs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/statuses/{sha}", + "languages_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/languages", + "stargazers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/stargazers", + "contributors_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contributors", + "subscribers_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscribers", + "subscription_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/subscription", + "commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/contents/{+path}", + "compare_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/merges", + "archive_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/downloads", + "issues_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/issues{/number}", + "pulls_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/pulls{/number}", + "milestones_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/milestones{/number}", + "notifications_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/labels{/name}", + "releases_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/releases{/id}", + "deployments_url": "https://api.github.com/repos/kohsuke2/GHContentIntegrationTest/deployments", + "created_at": "2014-05-10T22:50:30Z", + "updated_at": "2018-11-07T15:36:19Z", + "pushed_at": "2018-11-07T15:36:18Z", + "git_url": "git://github.com/kohsuke2/GHContentIntegrationTest.git", + "ssh_url": "git@github.com:kohsuke2/GHContentIntegrationTest.git", + "clone_url": "https://github.com/kohsuke2/GHContentIntegrationTest.git", + "svn_url": "https://github.com/kohsuke2/GHContentIntegrationTest", + "homepage": null, + "size": 111, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 1, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 1, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "source": { + "id": 14779458, + "node_id": "MDEwOlJlcG9zaXRvcnkxNDc3OTQ1OA==", + "name": "github-api-test-1", + "full_name": "farmdawgnation/github-api-test-1", + "private": false, + "owner": { + "login": "farmdawgnation", + "id": 620189, + "node_id": "MDQ6VXNlcjYyMDE4OQ==", + "avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/farmdawgnation", + "html_url": "https://github.com/farmdawgnation", + "followers_url": "https://api.github.com/users/farmdawgnation/followers", + "following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}", + "gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}", + "starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions", + "organizations_url": "https://api.github.com/users/farmdawgnation/orgs", + "repos_url": "https://api.github.com/users/farmdawgnation/repos", + "events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}", + "received_events_url": "https://api.github.com/users/farmdawgnation/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/farmdawgnation/github-api-test-1", + "description": "Repository used for integration test of github-api", + "fork": false, + "url": "https://api.github.com/repos/farmdawgnation/github-api-test-1", + "forks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/forks", + "keys_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/teams", + "hooks_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/hooks", + "issue_events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/events{/number}", + "events_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/events", + "assignees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/assignees{/user}", + "branches_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/branches{/branch}", + "tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/tags", + "blobs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/statuses/{sha}", + "languages_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/languages", + "stargazers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/stargazers", + "contributors_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contributors", + "subscribers_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscribers", + "subscription_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/subscription", + "commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/contents/{+path}", + "compare_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/merges", + "archive_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/downloads", + "issues_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/issues{/number}", + "pulls_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/pulls{/number}", + "milestones_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/milestones{/number}", + "notifications_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/labels{/name}", + "releases_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/releases{/id}", + "deployments_url": "https://api.github.com/repos/farmdawgnation/github-api-test-1/deployments", + "created_at": "2013-11-28T14:46:38Z", + "updated_at": "2016-02-05T13:33:23Z", + "pushed_at": "2013-11-28T14:55:36Z", + "git_url": "git://github.com/farmdawgnation/github-api-test-1.git", + "ssh_url": "git@github.com:farmdawgnation/github-api-test-1.git", + "clone_url": "https://github.com/farmdawgnation/github-api-test-1.git", + "svn_url": "https://github.com/farmdawgnation/github-api-test-1", + "homepage": null, + "size": 89, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 60, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 60, + "open_issues": 0, + "watchers": 0, + "default_branch": "main" + }, + "network_count": 60, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json new file mode 100644 index 0000000000..b2bf0b6737 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json @@ -0,0 +1,18 @@ +{ + "name": "a-file-with-content", + "path": "ghcontent-ro/a-file-with-content", + "sha": "901fd87750a8e53fe39a219cad50d4f7c80ca272", + "size": 22, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content", + "git_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/901fd87750a8e53fe39a219cad50d4f7c80ca272", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/GHContentIntegrationTest/main/ghcontent-ro/a-file-with-content", + "type": "file", + "content": "dGhhbmtzIGZvciByZWFkaW5nIG1lCg==\n", + "encoding": "base64", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "git": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/901fd87750a8e53fe39a219cad50d4f7c80ca272", + "html": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content" + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json new file mode 100644 index 0000000000..edfaef1ade --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/__files/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json @@ -0,0 +1,52 @@ +{ + "content": { + "name": "a-file-with-content", + "path": "ghcontent-ro/a-file-with-content", + "sha": "bbccddee11223344556677889900aabbccddeeff", + "size": 16, + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content", + "git_url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/bbccddee11223344556677889900aabbccddeeff", + "download_url": "https://raw.githubusercontent.com/hub4j-test-org/GHContentIntegrationTest/main/ghcontent-ro/a-file-with-content", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content?ref=main", + "git": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/blobs/bbccddee11223344556677889900aabbccddeeff", + "html": "https://github.com/hub4j-test-org/GHContentIntegrationTest/blob/main/ghcontent-ro/a-file-with-content" + } + }, + "commit": { + "sha": "2233445566778899001122334455667788990011", + "node_id": "MDY6Q29tbWl0NDA3NjM1Nzc6MjIzMzQ0NTU2Njc3ODg5OTAwMTEyMjMzNDQ1NTY2Nzc4ODk5MDAxMQ==", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits/2233445566778899001122334455667788990011", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/commit/2233445566778899001122334455667788990011", + "author": { + "name": "John Doe", + "email": "john@example.com", + "date": "2009-02-13T23:31:30Z" + }, + "committer": { + "name": "Service Account", + "email": "service@example.com", + "date": "2009-02-13T23:31:30Z" + }, + "tree": { + "sha": "ccdd00112233445566778899aabb00112233eeff", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/trees/ccdd00112233445566778899aabb00112233eeff" + }, + "message": "Updating with custom author and committer", + "parents": [ + { + "sha": "aaaa111122223333444455556666777788889999", + "url": "https://api.github.com/repos/hub4j-test-org/GHContentIntegrationTest/git/commits/aaaa111122223333444455556666777788889999", + "html_url": "https://github.com/hub4j-test-org/GHContentIntegrationTest/commit/aaaa111122223333444455556666777788889999" + } + ], + "verification": { + "verified": false, + "reason": "unsigned", + "signature": null, + "payload": null + } + } +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/1-user.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/1-user.json new file mode 100644 index 0000000000..867e80d5f8 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/1-user.json @@ -0,0 +1,48 @@ +{ + "id": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "1-user.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:23 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"be4370b3c906450f450e411f567ee839\"", + "Last-Modified": "Wed, 18 Dec 2019 01:26:55 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C05:B32660:5DFD9463" + } + }, + "uuid": "b9d02cd3-311a-4d49-8de8-aa4220400616", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json new file mode 100644 index 0000000000..a96af5128d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/2-r_h_ghcontentintegrationtest.json @@ -0,0 +1,48 @@ +{ + "id": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "name": "repos_hub4j-test-org_ghcontentintegrationtest", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "2-r_h_ghcontentintegrationtest.json", + "headers": { + "Date": "Sat, 21 Dec 2019 03:41:25 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1576903221", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"1e430d4199aa33f3d4673fee6fee2709\"", + "Last-Modified": "Tue, 26 Nov 2019 01:09:49 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "C977:4ACE:948C3A:B32669:5DFD9463" + } + }, + "uuid": "f60bd9fd-10cc-4488-b2ce-b618cac83ae2", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json new file mode 100644 index 0000000000..6191da8eb7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/3-r_h_g_contents_ghcontent-ro_a-file-with-content.json @@ -0,0 +1,24 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-200000000001", + "name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-file-with-content", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "3-r_h_g_contents_ghcontent-ro_a-file-with-content.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-200000000001", + "persistent": true, + "insertionIndex": 3 +} diff --git a/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json new file mode 100644 index 0000000000..c5664af76e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHContentIntegrationTest/wiremock/testUpdateWithAuthorCommitterAndDate/mappings/4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json @@ -0,0 +1,31 @@ +{ + "id": "a1b2c3d4-e5f6-7890-abcd-210000000002", + "name": "repos_hub4j-test-org_ghcontentintegrationtest_contents_ghcontent-ro_a-file-with-content_update_with_date", + "request": { + "url": "/repos/hub4j-test-org/GHContentIntegrationTest/contents/ghcontent-ro/a-file-with-content", + "method": "PUT", + "headers": { + "Accept": { + "equalTo": "application/vnd.github+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"path\":\"ghcontent-ro/a-file-with-content\",\"sha\":\"901fd87750a8e53fe39a219cad50d4f7c80ca272\",\"message\":\"Updating with custom author and committer\",\"content\":\"dXBkYXRlZCBjb250ZW50Cg==\",\"branch\":\"main\",\"author\":{\"name\":\"John Doe\",\"email\":\"john@example.com\",\"date\":\"2009-02-13T23:31:30Z\"},\"committer\":{\"name\":\"Service Account\",\"email\":\"service@example.com\",\"date\":\"2009-02-13T23:31:30Z\"}}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 200, + "bodyFileName": "4-r_h_g_contents_ghcontent-ro_a-file-with-content-update.json", + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK" + } + }, + "uuid": "a1b2c3d4-e5f6-7890-abcd-210000000002", + "persistent": true, + "insertionIndex": 4 +} From 36a12a023918490d9d44afcebcd305426caeb80c Mon Sep 17 00:00:00 2001 From: Sorena Sarabadani Date: Fri, 10 Apr 2026 03:20:51 +0200 Subject: [PATCH 05/23] refactor: make GHPullRequestReviewComment extend GHIssueComment (#2189) * refactor: make GHPullRequestReviewComment extend GHIssueComment * refactor: make GHPullRequestReviewComment extend GHIssueComment * fix: adjust tests --- .../org/kohsuke/github/GHIssueComment.java | 53 +++++++- .../github/GHPullRequestReviewComment.java | 113 +++++++----------- .../org/kohsuke/github/GHPullRequestTest.java | 3 + 3 files changed, 95 insertions(+), 74 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHIssueComment.java b/src/main/java/org/kohsuke/github/GHIssueComment.java index 51415248d6..39bfa13cba 100644 --- a/src/main/java/org/kohsuke/github/GHIssueComment.java +++ b/src/main/java/org/kohsuke/github/GHIssueComment.java @@ -39,9 +39,40 @@ */ public class GHIssueComment extends GHObject implements Reactable { - private String body, gravatarId, htmlUrl, authorAssociation; + /** + * Legacy field for gravatar ID (no longer returned by GitHub API). + */ + private String gravatarId; + + /** + * The author's association with the repository. + */ + protected String authorAssociation; - private GHUser user; // not fully populated. beware. + /** + * The comment body. + */ + protected String body; + + /** + * The comment body in HTML format. + */ + protected String bodyHtml; + + /** + * The comment body in plain text format. + */ + protected String bodyText; + + /** + * The HTML URL of the comment. + */ + protected String htmlUrl; + + /** + * The user who created the comment. Note: not fully populated, use getUser() for full details. + */ + protected GHUser user; /** The owner. */ GHIssue owner; @@ -115,6 +146,24 @@ public String getBody() { return body; } + /** + * Gets the body in HTML format. + * + * @return the body in HTML format + */ + public String getBodyHtml() { + return bodyHtml; + } + + /** + * Gets the body in plain text format. + * + * @return the body in plain text format + */ + public String getBodyText() { + return bodyText; + } + /** * Gets the html url. * diff --git a/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java b/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java index 85399cbf34..753396e73e 100644 --- a/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java +++ b/src/main/java/org/kohsuke/github/GHPullRequestReviewComment.java @@ -29,8 +29,6 @@ import java.io.IOException; import java.net.URL; -import javax.annotation.CheckForNull; - // TODO: Auto-generated Javadoc /** * Review comment to the pull request. @@ -40,10 +38,12 @@ * @see GHPullRequest#createReviewComment(String, String, String, int) GHPullRequest#createReviewComment(String, String, * String, int) */ -public class GHPullRequestReviewComment extends GHObject implements Reactable { +public class GHPullRequestReviewComment extends GHIssueComment implements Refreshable { /** - * The side of the diff to which the comment applies + * The side of the diff to which the comment applies. + * + * @see Pull Request Review Comments API */ public static enum Side { /** Left side */ @@ -66,31 +66,23 @@ public static Side from(String value) { } - private GHCommentAuthorAssociation authorAssociation; - - private String body; - private String bodyHtml; - private String bodyText; + // PR review comment specific fields (not in GHIssueComment) private String commitId; private String diffHunk; - private String htmlUrl; private long inReplyToId = -1L; private int line = -1; private String originalCommitId; private int originalLine = -1; private int originalPosition = -1; - private Integer originalStartLine = -1; + private Integer originalStartLine; private String path; private int position = -1; - private Long pullRequestReviewId = -1L; + private Long pullRequestReviewId; private String pullRequestUrl; private GHPullRequestReviewCommentReactions reactions; private String side; - private Integer startLine = -1; + private Integer startLine; private String startSide; - private GHUser user; - /** The owner. */ - GHPullRequest owner; /** * Create default GHPullRequestReviewComment instance @@ -107,6 +99,7 @@ public GHPullRequestReviewComment() { * @throws IOException * Signals that an I/O exception has occurred. */ + @Override public GHReaction createReaction(ReactionContent content) throws IOException { return owner.root() .createRequest() @@ -122,6 +115,7 @@ public GHReaction createReaction(ReactionContent content) throws IOException { * @throws IOException * the io exception */ + @Override public void delete() throws IOException { owner.root().createRequest().method("DELETE").withUrlPath(getApiRoute()).send(); } @@ -134,6 +128,7 @@ public void delete() throws IOException { * @throws IOException * Signals that an I/O exception has occurred. */ + @Override public void deleteReaction(GHReaction reaction) throws IOException { owner.root() .createRequest() @@ -142,42 +137,6 @@ public void deleteReaction(GHReaction reaction) throws IOException { .send(); } - /** - * Gets the author association to the project. - * - * @return the author association to the project - */ - public GHCommentAuthorAssociation getAuthorAssociation() { - return authorAssociation; - } - - /** - * The comment itself. - * - * @return the body - */ - public String getBody() { - return body; - } - - /** - * Gets The body in html format. - * - * @return {@link String} the body in html format - */ - public String getBodyHtml() { - return bodyHtml; - } - - /** - * Gets The body text. - * - * @return {@link String} the body text - */ - public String getBodyText() { - return bodyText; - } - /** * Gets commit id. * @@ -196,21 +155,11 @@ public String getDiffHunk() { return diffHunk; } - /** - * Gets the html url. - * - * @return the html url - */ - public URL getHtmlUrl() { - return GitHubClient.parseURL(htmlUrl); - } - /** * Gets in reply to id. * - * @return the in reply to id + * @return the in reply to id, or -1 if not a reply */ - @CheckForNull public long getInReplyToId() { return inReplyToId; } @@ -281,11 +230,12 @@ public int getOriginalStartLine() { /** * Gets the pull request to which this review comment is associated. * - * @return the parent + * @return the parent pull request */ + @Override @SuppressFBWarnings(value = { "EI_EXPOSE_REP" }, justification = "Expected behavior") public GHPullRequest getParent() { - return owner; + return (GHPullRequest) owner; } /** @@ -300,9 +250,8 @@ public String getPath() { /** * Gets position. * - * @return the position + * @return the position, or -1 if not available */ - @CheckForNull public int getPosition() { return position; } @@ -387,6 +336,7 @@ public Side getStartSide() { * @throws IOException * the io exception */ + @Override public GHUser getUser() throws IOException { return owner.root().intern(user); } @@ -396,6 +346,7 @@ public GHUser getUser() throws IOException { * * @return the paged iterable */ + @Override public PagedIterable listReactions() { return owner.root() .createRequest() @@ -403,6 +354,23 @@ public PagedIterable listReactions() { .toIterable(GHReaction[].class, item -> owner.root()); } + /** + * Refreshes this comment by fetching the full data from the API. + * + *

+ * This is useful when the comment was obtained via {@link GHPullRequestReview#listReviewComments()}, which uses a + * GitHub API endpoint that does not return all fields. After calling this method, fields like {@link #getLine()}, + * {@link #getOriginalLine()}, {@link #getSide()}, etc. will return their actual values. + * + * @throws IOException + * if an I/O error occurs + * @see GHPullRequest#listReviewComments() + */ + @Override + public void refresh() throws IOException { + owner.root().createRequest().withUrlPath(getApiRoute()).fetchInto(this).wrapUp(getParent()); + } + /** * Create a new comment that replies to this comment. * @@ -419,7 +387,7 @@ public GHPullRequestReviewComment reply(String body) throws IOException { .with("body", body) .withUrlPath(getApiRoute(true) + "/replies") .fetch(GHPullRequestReviewComment.class) - .wrapUp(owner); + .wrapUp(getParent()); } /** @@ -430,6 +398,7 @@ public GHPullRequestReviewComment reply(String body) throws IOException { * @throws IOException * the io exception */ + @Override public void update(String body) throws IOException { owner.root().createRequest().method("PATCH").with("body", body).withUrlPath(getApiRoute()).fetchInto(this); this.body = body; @@ -460,12 +429,12 @@ protected String getApiRoute(boolean includePullNumber) { /** * Wrap up. * - * @param owner - * the owner + * @param pullRequest + * the pull request owner * @return the GH pull request review comment */ - GHPullRequestReviewComment wrapUp(GHPullRequest owner) { - this.owner = owner; + GHPullRequestReviewComment wrapUp(GHPullRequest pullRequest) { + this.owner = pullRequest; return this; } } diff --git a/src/test/java/org/kohsuke/github/GHPullRequestTest.java b/src/test/java/org/kohsuke/github/GHPullRequestTest.java index c451128a0b..aa1aa231f4 100644 --- a/src/test/java/org/kohsuke/github/GHPullRequestTest.java +++ b/src/test/java/org/kohsuke/github/GHPullRequestTest.java @@ -764,6 +764,9 @@ public void pullRequestReviews() throws Exception { GHPullRequestReviewComment fullComment = comments.get(0).readPullRequestReviewComment(); assertThat(fullComment.getBody(), equalTo("Some niggle")); assertThat(fullComment.getLine(), equalTo(1)); + assertThat(fullComment.getParent().getNumber(), equalTo(p.getNumber())); + fullComment.refresh(); + assertThat(fullComment.getLine(), equalTo(1)); draftReview = p.createReview().body("Some new review").comment("Some niggle", "README.md", 1).create(); draftReview.delete(); From 7d60c7c01d69fd1a0080f0c0266750ab516996f8 Mon Sep 17 00:00:00 2001 From: bitwiseman <1958953+bitwiseman@users.noreply.github.com> Date: Fri, 10 Apr 2026 01:22:55 +0000 Subject: [PATCH 06/23] Prepare release (bitwiseman): github-api-2.0-rc.6 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 19fe7dc417..0e4548dbb8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.kohsuke ${github-api.artifactId} - 2.0-rc.6-SNAPSHOT + 2.0-rc.6 GitHub API for Java GitHub API for Java https://hub4j.github.io/github-api/ From f20b455e785f697d1c66fdd053f90fde35533217 Mon Sep 17 00:00:00 2001 From: bitwiseman <1958953+bitwiseman@users.noreply.github.com> Date: Fri, 10 Apr 2026 01:22:59 +0000 Subject: [PATCH 07/23] Prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0e4548dbb8..00ce33c86d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.kohsuke ${github-api.artifactId} - 2.0-rc.6 + 2.0-rc.7-SNAPSHOT GitHub API for Java GitHub API for Java https://hub4j.github.io/github-api/ From cc69c759709022081b03929b5e00ef605ea132cc Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Fri, 10 Apr 2026 01:48:45 -0700 Subject: [PATCH 08/23] Update dependabot.yml to check main-1.x branch --- .github/dependabot.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 74615e5f12..302259cfed 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,12 +3,32 @@ updates: - package-ecosystem: "maven" directory: "/" rebase-strategy: "disabled" + target-branch: "main" + open-pull-requests-limit: 10 schedule: interval: "monthly" time: "02:00" - package-ecosystem: "github-actions" directory: "/" rebase-strategy: "disabled" + target-branch: "main" + open-pull-requests-limit: 10 + schedule: + interval: "monthly" + time: "02:00" +- package-ecosystem: "maven" + directory: "/" + rebase-strategy: "disabled" + target-branch: "main-1.x" + open-pull-requests-limit: 10 + schedule: + interval: "monthly" + time: "02:00" +- package-ecosystem: "github-actions" + directory: "/" + rebase-strategy: "disabled" + target-branch: "main-1.x" + open-pull-requests-limit: 10 schedule: interval: "monthly" time: "02:00" From b336775625ebbaeb128ea712696d63f2c3ac8e2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:32:55 -0700 Subject: [PATCH 09/23] Chore(deps): Bump com.fasterxml.jackson:jackson-bom (#2226) Bumps [com.fasterxml.jackson:jackson-bom](https://github.com/FasterXML/jackson-bom) from 2.21.0 to 2.21.2. - [Commits](https://github.com/FasterXML/jackson-bom/compare/jackson-bom-2.21.0...jackson-bom-2.21.2) --- updated-dependencies: - dependency-name: com.fasterxml.jackson:jackson-bom dependency-version: 2.21.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 00ce33c86d..f985dab54a 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ com.fasterxml.jackson jackson-bom - 2.21.0 + 2.21.2 pom import From 375c4c316cdc85f09dc897fd84d298dc3fc05ff2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:33:27 -0700 Subject: [PATCH 10/23] Chore(deps-dev): Bump com.github.spotbugs:spotbugs-maven-plugin (#2232) Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.9.8.2 to 4.9.8.3. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.9.8.2...spotbugs-maven-plugin-4.9.8.3) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-version: 4.9.8.3 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f985dab54a..973c9ce7e1 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 3.16.0 UTF-8 true - 4.9.8.2 + 4.9.8.3 4.8.6 3.4.5 From dec69671be65cef1f7f40dfb46cf04bff2430a4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:33:48 -0700 Subject: [PATCH 11/23] Chore(deps): Bump org.apache.maven.scm:maven-scm-provider-gitexe (#2236) Bumps org.apache.maven.scm:maven-scm-provider-gitexe from 2.1.0 to 2.2.1. --- updated-dependencies: - dependency-name: org.apache.maven.scm:maven-scm-provider-gitexe dependency-version: 2.2.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 973c9ce7e1..da13eed223 100644 --- a/pom.xml +++ b/pom.xml @@ -683,7 +683,7 @@ org.apache.maven.scm maven-scm-provider-gitexe - 2.1.0 + 2.2.1 org.apache.maven.scm From 03d45406b8f32d14411efbc27acd6adf5356a142 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:34:01 -0700 Subject: [PATCH 12/23] Chore(deps-dev): Bump org.apache.maven.plugins:maven-enforcer-plugin (#2238) Bumps [org.apache.maven.plugins:maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 3.5.0 to 3.6.2. - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.5.0...enforcer-3.6.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-version: 3.6.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da13eed223..3e8ed04712 100644 --- a/pom.xml +++ b/pom.xml @@ -904,7 +904,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.5.0 + 3.6.2 enforce-jacoco-exist From 4d1f195adfbeb58a2e9849a14dc1e290a33f59cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:34:27 -0700 Subject: [PATCH 13/23] Chore(deps): Bump com.squareup.okio:okio from 3.16.0 to 3.17.0 (#2243) Bumps [com.squareup.okio:okio](https://github.com/square/okio) from 3.16.0 to 3.17.0. - [Changelog](https://github.com/square/okio/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okio/compare/parent-3.16.0...parent-3.17.0) --- updated-dependencies: - dependency-name: com.squareup.okio:okio dependency-version: 3.17.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3e8ed04712..5cc45376fe 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ https://ossrh-staging-api.central.sonatype.com 4.12.0 - 3.16.0 + 3.17.0 UTF-8 true 4.9.8.3 From 1cfd4d5e32e2241abbb42d3f21decab064d1cee6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:34:39 -0700 Subject: [PATCH 14/23] Chore(deps): Bump org.apache.maven.plugins:maven-source-plugin (#2244) Bumps [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.3.1 to 3.4.0. - [Release notes](https://github.com/apache/maven-source-plugin/releases) - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.3.1...maven-source-plugin-3.4.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-version: 3.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5cc45376fe..971cc6b869 100644 --- a/pom.xml +++ b/pom.xml @@ -344,7 +344,7 @@ maven-source-plugin - 3.3.1 + 3.4.0 maven-surefire-plugin From 591e037ac9b86d27c369fa2dc4cfafbbb93bde25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:35:00 -0700 Subject: [PATCH 15/23] Chore(deps-dev): Bump org.codehaus.mojo:versions-maven-plugin (#2248) Bumps [org.codehaus.mojo:versions-maven-plugin](https://github.com/mojohaus/versions) from 2.18.0 to 2.21.0. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.18.0...2.21.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-version: 2.21.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 971cc6b869..4fec2ed626 100644 --- a/pom.xml +++ b/pom.xml @@ -357,7 +357,7 @@ org.codehaus.mojo versions-maven-plugin - 2.18.0 + 2.21.0 org.jacoco From ef6b7abf98bb1d02b99ef86f5a82b2ec6f5b1fc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:35:28 -0700 Subject: [PATCH 16/23] Chore(deps-dev): Bump com.google.guava:guava (#2246) Bumps [com.google.guava:guava](https://github.com/google/guava) from 33.4.6-jre to 33.5.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-version: 33.5.0-jre dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4fec2ed626..733754aa57 100644 --- a/pom.xml +++ b/pom.xml @@ -217,7 +217,7 @@ com.google.guava guava - 33.4.6-jre + 33.5.0-jre test From 0856aad41b69b3c080bb58163ccb4ca92fd2a669 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:35:51 -0700 Subject: [PATCH 17/23] Chore(deps): Bump org.apache.maven.scm:maven-scm-provider-gitexe (#2214) Bumps org.apache.maven.scm:maven-scm-provider-gitexe from 2.1.0 to 2.2.1. --- updated-dependencies: - dependency-name: org.apache.maven.scm:maven-scm-provider-gitexe dependency-version: 2.2.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From 661544d7c75d078e355f797320298078a063a4c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 May 2026 13:58:42 -0700 Subject: [PATCH 18/23] Chore(deps-dev): Bump org.apache.maven.plugins:maven-release-plugin (#2264) Bumps [org.apache.maven.plugins:maven-release-plugin](https://github.com/apache/maven-release) from 3.1.1 to 3.3.1. - [Release notes](https://github.com/apache/maven-release/releases) - [Commits](https://github.com/apache/maven-release/compare/maven-release-3.1.1...maven-release-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-release-plugin dependency-version: 3.3.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 733754aa57..1c850e02f4 100644 --- a/pom.xml +++ b/pom.xml @@ -626,7 +626,7 @@ org.apache.maven.plugins maven-release-plugin - 3.1.1 + 3.3.1 true false From 8b35a20490d18fdd4162ee353cc15f804102e8af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 May 2026 13:58:58 -0700 Subject: [PATCH 19/23] Chore(deps-dev): Bump org.apache.maven.plugins:maven-compiler-plugin (#2263) Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.14.0 to 3.15.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.14.0...maven-compiler-plugin-3.15.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-version: 3.15.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1c850e02f4..42cc21c47d 100644 --- a/pom.xml +++ b/pom.xml @@ -585,7 +585,7 @@ maven-compiler-plugin - 3.14.0 + 3.15.0 11 11 From e9a7c5aa5bf2010edf91ecdacb6deb20e716d35b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 May 2026 13:59:22 -0700 Subject: [PATCH 20/23] Chore(deps): Bump org.apache.commons:commons-lang3 from 3.19.0 to 3.20.0 (#2259) Bumps org.apache.commons:commons-lang3 from 3.19.0 to 3.20.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-version: 3.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 42cc21c47d..5155ae2f22 100644 --- a/pom.xml +++ b/pom.xml @@ -194,7 +194,7 @@ org.apache.commons commons-lang3 - 3.19.0 + 3.20.0 com.github.npathai From d551592a4e72ac233849ca6b8ace0866cf6cf57e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 May 2026 13:59:43 -0700 Subject: [PATCH 21/23] Chore(deps-dev): Bump com.tngtech.archunit:archunit from 1.4.1 to 1.4.2 (#2256) Bumps [com.tngtech.archunit:archunit](https://github.com/TNG/ArchUnit) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/TNG/ArchUnit/releases) - [Commits](https://github.com/TNG/ArchUnit/compare/v1.4.1...v1.4.2) --- updated-dependencies: - dependency-name: com.tngtech.archunit:archunit dependency-version: 1.4.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5155ae2f22..853a417ad2 100644 --- a/pom.xml +++ b/pom.xml @@ -223,7 +223,7 @@ com.tngtech.archunit archunit - 1.4.1 + 1.4.2 test From f64a90471b4357902d255bcdadab62028b55b9eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 May 2026 14:00:12 -0700 Subject: [PATCH 22/23] Chore(deps-dev): Bump org.mockito:mockito-core from 5.21.0 to 5.23.0 (#2239) Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.21.0 to 5.23.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.21.0...v5.23.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-version: 5.23.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Liam Newman --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 853a417ad2..3cb0872e38 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ org.mockito mockito-core - 5.21.0 + 5.23.0 test