From eb5718dabf4e3d2a7fe3c1fe57b109809658af23 Mon Sep 17 00:00:00 2001 From: "Baur Daniel (HAU-ITE)" Date: Thu, 10 Aug 2023 08:27:37 +0200 Subject: [PATCH 1/5] call toString on visibility enum --- src/main/java/org/kohsuke/github/GHRepositoryBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java b/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java index 17ee0041d4..1d8602a044 100644 --- a/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java +++ b/src/main/java/org/kohsuke/github/GHRepositoryBuilder.java @@ -167,7 +167,7 @@ public S private_(boolean enabled) throws IOException { */ public S visibility(final Visibility visibility) throws IOException { requester.withPreview(NEBULA); - return with("visibility", visibility); + return with("visibility", visibility.toString()); } /** From 0dd17a1ec26ec79e121d5f11c715aa2d53096356 Mon Sep 17 00:00:00 2001 From: "Baur Daniel (HAU-ITE)" Date: Thu, 10 Aug 2023 08:37:09 +0200 Subject: [PATCH 2/5] draft visibility test --- .../org/kohsuke/github/GHRepositoryTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index d9bd5165d7..6a6e0da429 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -310,6 +310,29 @@ public void testSetPublic() throws Exception { } } + /** + * Tests the creation of repositories with alternating visibilities. + * + * @throws Exception + * the exception + */ + @Test + public void testSetVisibility() throws Exception { + kohsuke(); + GHUser myself = gitHub.getMyself(); + String repoName = "test-repo-visibility"; + + for (Visibility visibility : Visibility.values()) { + GHRepository repository = gitHub.createRepository(repoName).visibility(visibility).create(); + try { + assertThat(repository.getVisibility(), is(visibility)); + assertThat(myself.getRepository(repoName).getVisibility(), is(visibility)); + } finally { + repository.delete(); + } + } + } + /** * Test update repository. * From 7c1e25bd3c976fbfdfec5b9b8302c78073e41761 Mon Sep 17 00:00:00 2001 From: "Baur Daniel (HAU-ITE)" Date: Thu, 10 Aug 2023 09:19:58 +0200 Subject: [PATCH 3/5] finalize test and take snapshot --- .../org/kohsuke/github/GHRepositoryTest.java | 12 +- .../__files/orgs_hub4j-test-org-2.json | 65 ++++++++ .../__files/orgs_hub4j-test-org_repos-3.json | 140 ++++++++++++++++ .../__files/orgs_hub4j-test-org_repos-6.json | 140 ++++++++++++++++ ...hub4j-test-org_test-repo-visibility-4.json | 152 ++++++++++++++++++ ...hub4j-test-org_test-repo-visibility-7.json | 141 ++++++++++++++++ .../testSetVisibility/__files/user-1.json | 46 ++++++ .../mappings/orgs_hub4j-test-org-2.json | 51 ++++++ .../mappings/orgs_hub4j-test-org_repos-3.json | 58 +++++++ .../mappings/orgs_hub4j-test-org_repos-6.json | 58 +++++++ ...hub4j-test-org_test-repo-visibility-4.json | 54 +++++++ ...hub4j-test-org_test-repo-visibility-5.json | 46 ++++++ ...hub4j-test-org_test-repo-visibility-7.json | 53 ++++++ ...hub4j-test-org_test-repo-visibility-8.json | 45 ++++++ .../testSetVisibility/mappings/user-1.json | 51 ++++++ 15 files changed, 1107 insertions(+), 5 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-4.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-7.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-4.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-5.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-7.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-8.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 6a6e0da429..9310718c01 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -1,6 +1,7 @@ package org.kohsuke.github; import com.fasterxml.jackson.databind.JsonMappingException; +import com.google.common.collect.Sets; import org.apache.commons.io.IOUtils; import org.junit.Assert; import org.junit.Test; @@ -318,15 +319,16 @@ public void testSetPublic() throws Exception { */ @Test public void testSetVisibility() throws Exception { - kohsuke(); - GHUser myself = gitHub.getMyself(); String repoName = "test-repo-visibility"; - for (Visibility visibility : Visibility.values()) { - GHRepository repository = gitHub.createRepository(repoName).visibility(visibility).create(); + GHOrganization organization = gitHub.getOrganization(GITHUB_API_TEST_ORG); + + // can not test for internal, as test org is not assigned to an enterprise + for (Visibility visibility : Sets.newHashSet(Visibility.PUBLIC, Visibility.PRIVATE)) { + GHRepository repository = organization.createRepository(repoName).visibility(visibility).create(); try { assertThat(repository.getVisibility(), is(visibility)); - assertThat(myself.getRepository(repoName).getVisibility(), is(visibility)); + assertThat(organization.getRepository(repoName).getVisibility(), is(visibility)); } finally { repository.delete(); } diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..ff5c615dfa --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org-2.json @@ -0,0 +1,65 @@ +{ + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/hub4j-test-org", + "repos_url": "https://api.github.com/orgs/hub4j-test-org/repos", + "events_url": "https://api.github.com/orgs/hub4j-test-org/events", + "hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks", + "issues_url": "https://api.github.com/orgs/hub4j-test-org/issues", + "members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}", + "avatar_url": "https://avatars.githubusercontent.com/u/7544739?v=4", + "description": "Hub4j Test Org Description (this could be null or blank too)", + "name": "Hub4j Test Org Name (this could be null or blank too)", + "company": null, + "blog": "https://hub4j.url.io/could/be/null", + "location": "Hub4j Test Org Location (this could be null or blank too)", + "email": "hub4jtestorgemail@could.be.null.com", + "twitter_username": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 26, + "public_gists": 0, + "followers": 1, + "following": 0, + "html_url": "https://github.com/hub4j-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2020-06-04T05:56:10Z", + "archived_at": null, + "type": "Organization", + "total_private_repos": 6, + "owned_private_repos": 6, + "private_gists": 0, + "disk_usage": 12007, + "collaborators": 1, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "members_allowed_repository_creation_type": "none", + "members_can_create_public_repositories": false, + "members_can_create_private_repositories": false, + "members_can_create_internal_repositories": false, + "members_can_create_pages": true, + "members_can_fork_private_repositories": false, + "web_commit_signoff_required": false, + "members_can_create_public_pages": true, + "members_can_create_private_pages": true, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 10000, + "filled_seats": 46, + "seats": 3 + }, + "advanced_security_enabled_for_new_repositories": false, + "dependabot_alerts_enabled_for_new_repositories": false, + "dependabot_security_updates_enabled_for_new_repositories": false, + "dependency_graph_enabled_for_new_repositories": false, + "secret_scanning_enabled_for_new_repositories": false, + "secret_scanning_push_protection_enabled_for_new_repositories": false, + "secret_scanning_push_protection_custom_link_enabled": false, + "secret_scanning_push_protection_custom_link": null +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json new file mode 100644 index 0000000000..291db2eea7 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json @@ -0,0 +1,140 @@ +{ + "id": 676861126, + "node_id": "R_kgDOKFgUxg", + "name": "test-repo-visibility", + "full_name": "hub4j-test-org/test-repo-visibility", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.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/test-repo-visibility", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/deployments", + "created_at": "2023-08-10T07:18:54Z", + "updated_at": "2023-08-10T07:18:54Z", + "pushed_at": "2023-08-10T07:18:54Z", + "git_url": "git://github.com/hub4j-test-org/test-repo-visibility.git", + "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility.git", + "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility.git", + "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "homepage": null, + "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, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.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 + }, + "network_count": 0, + "subscribers_count": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json new file mode 100644 index 0000000000..47730900ec --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json @@ -0,0 +1,140 @@ +{ + "id": 676861134, + "node_id": "R_kgDOKFgUzg", + "name": "test-repo-visibility", + "full_name": "hub4j-test-org/test-repo-visibility", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.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/test-repo-visibility", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/deployments", + "created_at": "2023-08-10T07:18:56Z", + "updated_at": "2023-08-10T07:18:56Z", + "pushed_at": "2023-08-10T07:18:56Z", + "git_url": "git://github.com/hub4j-test-org/test-repo-visibility.git", + "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility.git", + "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility.git", + "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.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 + }, + "network_count": 0, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-4.json new file mode 100644 index 0000000000..84f6f6732a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-4.json @@ -0,0 +1,152 @@ +{ + "id": 676861126, + "node_id": "R_kgDOKFgUxg", + "name": "test-repo-visibility", + "full_name": "hub4j-test-org/test-repo-visibility", + "private": false, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.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/test-repo-visibility", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/deployments", + "created_at": "2023-08-10T07:18:54Z", + "updated_at": "2023-08-10T07:18:54Z", + "pushed_at": "2023-08-10T07:18:54Z", + "git_url": "git://github.com/hub4j-test-org/test-repo-visibility.git", + "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility.git", + "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility.git", + "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "homepage": null, + "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, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.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 + }, + "security_and_analysis": { + "secret_scanning": { + "status": "disabled" + }, + "secret_scanning_push_protection": { + "status": "disabled" + }, + "dependabot_security_updates": { + "status": "disabled" + } + }, + "network_count": 0, + "subscribers_count": 14 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-7.json new file mode 100644 index 0000000000..95666d0476 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-7.json @@ -0,0 +1,141 @@ +{ + "id": 676861134, + "node_id": "R_kgDOKFgUzg", + "name": "test-repo-visibility", + "full_name": "hub4j-test-org/test-repo-visibility", + "private": true, + "owner": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.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/test-repo-visibility", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/deployments", + "created_at": "2023-08-10T07:18:56Z", + "updated_at": "2023-08-10T07:18:56Z", + "pushed_at": "2023-08-10T07:18:56Z", + "git_url": "git://github.com/hub4j-test-org/test-repo-visibility.git", + "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility.git", + "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility.git", + "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": false, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "ABXKPQEKVQH2LAM3ZT4TLOLE2SII2", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "organization": { + "login": "hub4j-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars.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 + }, + "network_count": 0, + "subscribers_count": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/user-1.json new file mode 100644 index 0000000000..21dc04da7c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "login": "dbaur", + "id": 7251904, + "node_id": "MDQ6VXNlcjcyNTE5MDQ=", + "avatar_url": "https://avatars.githubusercontent.com/u/7251904?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dbaur", + "html_url": "https://github.com/dbaur", + "followers_url": "https://api.github.com/users/dbaur/followers", + "following_url": "https://api.github.com/users/dbaur/following{/other_user}", + "gists_url": "https://api.github.com/users/dbaur/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dbaur/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dbaur/subscriptions", + "organizations_url": "https://api.github.com/users/dbaur/orgs", + "repos_url": "https://api.github.com/users/dbaur/repos", + "events_url": "https://api.github.com/users/dbaur/events{/privacy}", + "received_events_url": "https://api.github.com/users/dbaur/received_events", + "type": "User", + "site_admin": false, + "name": "Daniel Baur", + "company": null, + "blog": "", + "location": "Ulm", + "email": null, + "hireable": null, + "bio": null, + "twitter_username": null, + "public_repos": 50, + "public_gists": 0, + "followers": 7, + "following": 10, + "created_at": "2014-04-10T14:14:43Z", + "updated_at": "2023-07-28T11:30:28Z", + "private_gists": 3, + "total_private_repos": 13, + "owned_private_repos": 13, + "disk_usage": 104958, + "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/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..f200158fbd --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,51 @@ +{ + "id": "f36721dd-93a2-4ee8-93c7-2606a3fda89d", + "name": "orgs_hub4j-test-org", + "request": { + "url": "/orgs/hub4j-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_hub4j-test-org-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 07:18:54 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"a78356b24c70002a5c721d7789be4984765938105a496ee45980bd8e2b4acb8a\"", + "Last-Modified": "Thu, 04 Jun 2020 05:56:10 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4933", + "X-RateLimit-Reset": "1691653436", + "X-RateLimit-Used": "67", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "1177:3986:C1F0E05:C3A7061:64D48F5D" + } + }, + "uuid": "f36721dd-93a2-4ee8-93c7-2606a3fda89d", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json new file mode 100644 index 0000000000..2a8d0c1d4e --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json @@ -0,0 +1,58 @@ +{ + "id": "e5597307-486b-4d27-8cf2-39ebbf502cee", + "name": "orgs_hub4j-test-org_repos", + "request": { + "url": "/orgs/hub4j-test-org/repos", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.nebula-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"visibility\":\"public\",\"name\":\"test-repo-visibility\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_hub4j-test-org_repos-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 07:18:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"4ea5f7ebb6870742d7ef1111f061ebf5aa8c3d166dea426dd056327874e5e668\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "public_repo, repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; param=nebula-preview; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4932", + "X-RateLimit-Reset": "1691653436", + "X-RateLimit-Used": "68", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "A971:0F26:BB81279:BD37464:64D48F5E", + "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility" + } + }, + "uuid": "e5597307-486b-4d27-8cf2-39ebbf502cee", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json new file mode 100644 index 0000000000..b0860a2227 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json @@ -0,0 +1,58 @@ +{ + "id": "2e1e4794-5963-433b-8980-5e367513ca6d", + "name": "orgs_hub4j-test-org_repos", + "request": { + "url": "/orgs/hub4j-test-org/repos", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.nebula-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"visibility\":\"private\",\"name\":\"test-repo-visibility\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_hub4j-test-org_repos-6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 07:18:57 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"ea08c68306302e0e4f696330043eb2cfa4903411fec5ce2cbc4adff2f7e51d73\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "public_repo, repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; param=nebula-preview; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4929", + "X-RateLimit-Reset": "1691653436", + "X-RateLimit-Used": "71", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "5C8D:1B9A:A1DF6A4:A369045:64D48F60", + "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility" + } + }, + "uuid": "2e1e4794-5963-433b-8980-5e367513ca6d", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-4.json new file mode 100644 index 0000000000..31f73aa515 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-4.json @@ -0,0 +1,54 @@ +{ + "id": "f92bb19d-814a-41aa-b33a-2d46b6854431", + "name": "repos_hub4j-test-org_test-repo-visibility", + "request": { + "url": "/repos/hub4j-test-org/test-repo-visibility", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-4.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 07:18:55 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"c0bbd645a3cd754b7cd39d3ab2d8f9ac24bd528a0092e6fc4a6edfd8012950f8\"", + "Last-Modified": "Thu, 10 Aug 2023 07:18:54 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4931", + "X-RateLimit-Reset": "1691653436", + "X-RateLimit-Used": "69", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "A1F5:0BF2:C07804F:C22E2AA:64D48F5F" + } + }, + "uuid": "f92bb19d-814a-41aa-b33a-2d46b6854431", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-test-repo-visibility", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-hub4j-test-org-test-repo-visibility-2", + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-5.json new file mode 100644 index 0000000000..21626ebac6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-5.json @@ -0,0 +1,46 @@ +{ + "id": "55176ff0-c55c-4020-8bb4-cc6ad6ce9a15", + "name": "repos_hub4j-test-org_test-repo-visibility", + "request": { + "url": "/repos/hub4j-test-org/test-repo-visibility", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 07:18:56 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "delete_repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4930", + "X-RateLimit-Reset": "1691653436", + "X-RateLimit-Used": "70", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "C272:1B9A:A1DF4E9:A368E72:64D48F5F" + } + }, + "uuid": "55176ff0-c55c-4020-8bb4-cc6ad6ce9a15", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-test-repo-visibility", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-2-repos-hub4j-test-org-test-repo-visibility-2", + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-7.json new file mode 100644 index 0000000000..4732254953 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-7.json @@ -0,0 +1,53 @@ +{ + "id": "0f5b7d83-b28a-4539-9049-c34239fd494e", + "name": "repos_hub4j-test-org_test-repo-visibility", + "request": { + "url": "/repos/hub4j-test-org/test-repo-visibility", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-7.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 07:18:57 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"b07ffdafba20cf8f8f4100797f4be0428989dfe0fff6bdc2b7746e4960194765\"", + "Last-Modified": "Thu, 10 Aug 2023 07:18:56 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4928", + "X-RateLimit-Reset": "1691653436", + "X-RateLimit-Used": "72", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "E8ED:6CA9:4A1AAE3:4ACB8CA:64D48F61" + } + }, + "uuid": "0f5b7d83-b28a-4539-9049-c34239fd494e", + "persistent": true, + "scenarioName": "scenario-1-repos-hub4j-test-org-test-repo-visibility", + "requiredScenarioState": "scenario-1-repos-hub4j-test-org-test-repo-visibility-2", + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-8.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-8.json new file mode 100644 index 0000000000..1e08f65f57 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-8.json @@ -0,0 +1,45 @@ +{ + "id": "6d7050e5-ee36-4656-b4c2-f2e78d6f136d", + "name": "repos_hub4j-test-org_test-repo-visibility", + "request": { + "url": "/repos/hub4j-test-org/test-repo-visibility", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 07:18:58 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4927", + "X-RateLimit-Reset": "1691653436", + "X-RateLimit-Used": "73", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "A440:73C9:B7F5020:B9AB131:64D48F61" + } + }, + "uuid": "6d7050e5-ee36-4656-b4c2-f2e78d6f136d", + "persistent": true, + "scenarioName": "scenario-2-repos-hub4j-test-org-test-repo-visibility", + "requiredScenarioState": "scenario-2-repos-hub4j-test-org-test-repo-visibility-2", + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json new file mode 100644 index 0000000000..857b160cae --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json @@ -0,0 +1,51 @@ +{ + "id": "daa90f97-80a4-4363-b491-e1395dd797c6", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 07:18:53 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"548cf23283fa0524609b0128ffe4d2e4d8bfe278a54ae9a93c7bbdcf6b9e199b\"", + "Last-Modified": "Fri, 28 Jul 2023 11:30:28 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4935", + "X-RateLimit-Reset": "1691653436", + "X-RateLimit-Used": "65", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "B79A:AC85:B981BF3:BB37DAE:64D48F5D" + } + }, + "uuid": "daa90f97-80a4-4363-b491-e1395dd797c6", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file From 2624bbb2ec0a33cdf0d5ebb8a7d42b4d141322b1 Mon Sep 17 00:00:00 2001 From: "Baur Daniel (HAU-ITE)" Date: Thu, 10 Aug 2023 09:46:31 +0200 Subject: [PATCH 4/5] use unique repo name per visibility, update snapshots --- .../org/kohsuke/github/GHRepositoryTest.java | 3 +- .../__files/orgs_hub4j-test-org_repos-3.json | 98 ++++++++--------- .../__files/orgs_hub4j-test-org_repos-6.json | 100 ++++++++--------- ...t-org_test-repo-visibility-private-7.json} | 102 +++++++++--------- ...st-org_test-repo-visibility-public-4.json} | 98 ++++++++--------- .../mappings/orgs_hub4j-test-org-2.json | 14 +-- .../mappings/orgs_hub4j-test-org_repos-3.json | 20 ++-- .../mappings/orgs_hub4j-test-org_repos-6.json | 20 ++-- ...t-org_test-repo-visibility-private-7.json} | 26 +++-- ...t-org_test-repo-visibility-private-8.json} | 20 ++-- ...st-org_test-repo-visibility-public-4.json} | 27 +++-- ...st-org_test-repo-visibility-public-5.json} | 21 ++-- .../testSetVisibility/mappings/user-1.json | 14 +-- 13 files changed, 276 insertions(+), 287 deletions(-) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/{repos_hub4j-test-org_test-repo-visibility-7.json => repos_hub4j-test-org_test-repo-visibility-private-7.json} (74%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/{repos_hub4j-test-org_test-repo-visibility-4.json => repos_hub4j-test-org_test-repo-visibility-public-4.json} (76%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/{repos_hub4j-test-org_test-repo-visibility-7.json => repos_hub4j-test-org_test-repo-visibility-private-7.json} (68%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/{repos_hub4j-test-org_test-repo-visibility-8.json => repos_hub4j-test-org_test-repo-visibility-private-8.json} (73%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/{repos_hub4j-test-org_test-repo-visibility-4.json => repos_hub4j-test-org_test-repo-visibility-public-4.json} (68%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/{repos_hub4j-test-org_test-repo-visibility-5.json => repos_hub4j-test-org_test-repo-visibility-public-5.json} (72%) diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 9310718c01..02ba5bf7aa 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -319,12 +319,11 @@ public void testSetPublic() throws Exception { */ @Test public void testSetVisibility() throws Exception { - String repoName = "test-repo-visibility"; - GHOrganization organization = gitHub.getOrganization(GITHUB_API_TEST_ORG); // can not test for internal, as test org is not assigned to an enterprise for (Visibility visibility : Sets.newHashSet(Visibility.PUBLIC, Visibility.PRIVATE)) { + String repoName = String.format("test-repo-visibility-%s", visibility.toString()); GHRepository repository = organization.createRepository(repoName).visibility(visibility).create(); try { assertThat(repository.getVisibility(), is(visibility)); diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json index 291db2eea7..1875e8cf1e 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json @@ -1,8 +1,8 @@ { - "id": 676861126, - "node_id": "R_kgDOKFgUxg", - "name": "test-repo-visibility", - "full_name": "hub4j-test-org/test-repo-visibility", + "id": 676869680, + "node_id": "R_kgDOKFg2MA", + "name": "test-repo-visibility-public", + "full_name": "hub4j-test-org/test-repo-visibility-public", "private": false, "owner": { "login": "hub4j-test-org", @@ -24,53 +24,53 @@ "type": "Organization", "site_admin": false }, - "html_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "html_url": "https://github.com/hub4j-test-org/test-repo-visibility-public", "description": null, "fork": false, - "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility", - "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/forks", - "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/teams", - "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/hooks", - "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/events{/number}", - "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/events", - "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/assignees{/user}", - "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/branches{/branch}", - "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/tags", - "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/statuses/{sha}", - "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/languages", - "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/stargazers", - "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contributors", - "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscribers", - "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscription", - "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contents/{+path}", - "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/merges", - "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/downloads", - "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues{/number}", - "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/pulls{/number}", - "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/milestones{/number}", - "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/labels{/name}", - "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/releases{/id}", - "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/deployments", - "created_at": "2023-08-10T07:18:54Z", - "updated_at": "2023-08-10T07:18:54Z", - "pushed_at": "2023-08-10T07:18:54Z", - "git_url": "git://github.com/hub4j-test-org/test-repo-visibility.git", - "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility.git", - "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility.git", - "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/deployments", + "created_at": "2023-08-10T07:45:44Z", + "updated_at": "2023-08-10T07:45:45Z", + "pushed_at": "2023-08-10T07:45:45Z", + "git_url": "git://github.com/hub4j-test-org/test-repo-visibility-public.git", + "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility-public.git", + "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility-public.git", + "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility-public", "homepage": null, "size": 0, "stargazers_count": 0, diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json index 47730900ec..5496625969 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json @@ -1,8 +1,8 @@ { - "id": 676861134, - "node_id": "R_kgDOKFgUzg", - "name": "test-repo-visibility", - "full_name": "hub4j-test-org/test-repo-visibility", + "id": 676869689, + "node_id": "R_kgDOKFg2OQ", + "name": "test-repo-visibility-private", + "full_name": "hub4j-test-org/test-repo-visibility-private", "private": true, "owner": { "login": "hub4j-test-org", @@ -24,53 +24,53 @@ "type": "Organization", "site_admin": false }, - "html_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "html_url": "https://github.com/hub4j-test-org/test-repo-visibility-private", "description": null, "fork": false, - "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility", - "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/forks", - "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/teams", - "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/hooks", - "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/events{/number}", - "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/events", - "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/assignees{/user}", - "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/branches{/branch}", - "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/tags", - "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/statuses/{sha}", - "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/languages", - "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/stargazers", - "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contributors", - "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscribers", - "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscription", - "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contents/{+path}", - "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/merges", - "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/downloads", - "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues{/number}", - "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/pulls{/number}", - "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/milestones{/number}", - "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/labels{/name}", - "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/releases{/id}", - "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/deployments", - "created_at": "2023-08-10T07:18:56Z", - "updated_at": "2023-08-10T07:18:56Z", - "pushed_at": "2023-08-10T07:18:56Z", - "git_url": "git://github.com/hub4j-test-org/test-repo-visibility.git", - "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility.git", - "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility.git", - "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/deployments", + "created_at": "2023-08-10T07:45:47Z", + "updated_at": "2023-08-10T07:45:47Z", + "pushed_at": "2023-08-10T07:45:47Z", + "git_url": "git://github.com/hub4j-test-org/test-repo-visibility-private.git", + "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility-private.git", + "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility-private.git", + "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility-private", "homepage": null, "size": 0, "stargazers_count": 0, @@ -136,5 +136,5 @@ "site_admin": false }, "network_count": 0, - "subscribers_count": 0 + "subscribers_count": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json similarity index 74% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-7.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json index 95666d0476..d77b92d3c2 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-7.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json @@ -1,8 +1,8 @@ { - "id": 676861134, - "node_id": "R_kgDOKFgUzg", - "name": "test-repo-visibility", - "full_name": "hub4j-test-org/test-repo-visibility", + "id": 676869689, + "node_id": "R_kgDOKFg2OQ", + "name": "test-repo-visibility-private", + "full_name": "hub4j-test-org/test-repo-visibility-private", "private": true, "owner": { "login": "hub4j-test-org", @@ -24,53 +24,53 @@ "type": "Organization", "site_admin": false }, - "html_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "html_url": "https://github.com/hub4j-test-org/test-repo-visibility-private", "description": null, "fork": false, - "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility", - "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/forks", - "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/teams", - "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/hooks", - "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/events{/number}", - "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/events", - "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/assignees{/user}", - "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/branches{/branch}", - "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/tags", - "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/statuses/{sha}", - "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/languages", - "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/stargazers", - "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contributors", - "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscribers", - "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscription", - "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contents/{+path}", - "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/merges", - "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/downloads", - "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues{/number}", - "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/pulls{/number}", - "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/milestones{/number}", - "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/labels{/name}", - "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/releases{/id}", - "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/deployments", - "created_at": "2023-08-10T07:18:56Z", - "updated_at": "2023-08-10T07:18:56Z", - "pushed_at": "2023-08-10T07:18:56Z", - "git_url": "git://github.com/hub4j-test-org/test-repo-visibility.git", - "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility.git", - "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility.git", - "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/deployments", + "created_at": "2023-08-10T07:45:47Z", + "updated_at": "2023-08-10T07:45:47Z", + "pushed_at": "2023-08-10T07:45:47Z", + "git_url": "git://github.com/hub4j-test-org/test-repo-visibility-private.git", + "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility-private.git", + "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility-private.git", + "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility-private", "homepage": null, "size": 0, "stargazers_count": 0, @@ -104,7 +104,7 @@ "triage": true, "pull": true }, - "temp_clone_token": "ABXKPQEKVQH2LAM3ZT4TLOLE2SII2", + "temp_clone_token": "ABXKPQBITLCODHOOYTH5CXTE2SLNQ", "allow_squash_merge": true, "allow_merge_commit": true, "allow_rebase_merge": true, @@ -137,5 +137,5 @@ "site_admin": false }, "network_count": 0, - "subscribers_count": 5 + "subscribers_count": 8 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json similarity index 76% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-4.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json index 84f6f6732a..3ab9635eba 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-4.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json @@ -1,8 +1,8 @@ { - "id": 676861126, - "node_id": "R_kgDOKFgUxg", - "name": "test-repo-visibility", - "full_name": "hub4j-test-org/test-repo-visibility", + "id": 676869680, + "node_id": "R_kgDOKFg2MA", + "name": "test-repo-visibility-public", + "full_name": "hub4j-test-org/test-repo-visibility-public", "private": false, "owner": { "login": "hub4j-test-org", @@ -24,53 +24,53 @@ "type": "Organization", "site_admin": false }, - "html_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "html_url": "https://github.com/hub4j-test-org/test-repo-visibility-public", "description": null, "fork": false, - "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility", - "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/forks", - "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/teams", - "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/hooks", - "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/events{/number}", - "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/events", - "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/assignees{/user}", - "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/branches{/branch}", - "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/tags", - "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/statuses/{sha}", - "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/languages", - "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/stargazers", - "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contributors", - "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscribers", - "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/subscription", - "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/contents/{+path}", - "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/merges", - "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/downloads", - "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/issues{/number}", - "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/pulls{/number}", - "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/milestones{/number}", - "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/labels{/name}", - "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/releases{/id}", - "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility/deployments", - "created_at": "2023-08-10T07:18:54Z", - "updated_at": "2023-08-10T07:18:54Z", - "pushed_at": "2023-08-10T07:18:54Z", - "git_url": "git://github.com/hub4j-test-org/test-repo-visibility.git", - "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility.git", - "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility.git", - "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility", + "url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public", + "forks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/forks", + "keys_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/teams", + "hooks_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/hooks", + "issue_events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/issues/events{/number}", + "events_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/events", + "assignees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/assignees{/user}", + "branches_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/branches{/branch}", + "tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/tags", + "blobs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/statuses/{sha}", + "languages_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/languages", + "stargazers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/stargazers", + "contributors_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/contributors", + "subscribers_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/subscribers", + "subscription_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/subscription", + "commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/contents/{+path}", + "compare_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/merges", + "archive_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/downloads", + "issues_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/issues{/number}", + "pulls_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/pulls{/number}", + "milestones_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/milestones{/number}", + "notifications_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/labels{/name}", + "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/releases{/id}", + "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/deployments", + "created_at": "2023-08-10T07:45:44Z", + "updated_at": "2023-08-10T07:45:45Z", + "pushed_at": "2023-08-10T07:45:45Z", + "git_url": "git://github.com/hub4j-test-org/test-repo-visibility-public.git", + "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility-public.git", + "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility-public.git", + "svn_url": "https://github.com/hub4j-test-org/test-repo-visibility-public", "homepage": null, "size": 0, "stargazers_count": 0, diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json index f200158fbd..a5db5e17e4 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json @@ -1,5 +1,5 @@ { - "id": "f36721dd-93a2-4ee8-93c7-2606a3fda89d", + "id": "6a53a088-20f1-4c0c-b7cf-0aa8d1d974e2", "name": "orgs_hub4j-test-org", "request": { "url": "/orgs/hub4j-test-org", @@ -15,7 +15,7 @@ "bodyFileName": "orgs_hub4j-test-org-2.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:18:54 GMT", + "Date": "Thu, 10 Aug 2023 07:45:44 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ @@ -30,9 +30,9 @@ "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4933", - "X-RateLimit-Reset": "1691653436", - "X-RateLimit-Used": "67", + "X-RateLimit-Remaining": "4987", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "13", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -42,10 +42,10 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "1177:3986:C1F0E05:C3A7061:64D48F5D" + "X-GitHub-Request-Id": "2EA5:E1BB:82E0A26:84107E1:64D495A8" } }, - "uuid": "f36721dd-93a2-4ee8-93c7-2606a3fda89d", + "uuid": "6a53a088-20f1-4c0c-b7cf-0aa8d1d974e2", "persistent": true, "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json index 2a8d0c1d4e..212e772560 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json @@ -1,5 +1,5 @@ { - "id": "e5597307-486b-4d27-8cf2-39ebbf502cee", + "id": "188bae51-0c10-4be0-b3c6-eb6b45414866", "name": "orgs_hub4j-test-org_repos", "request": { "url": "/orgs/hub4j-test-org/repos", @@ -11,7 +11,7 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"visibility\":\"public\",\"name\":\"test-repo-visibility\"}", + "equalToJson": "{\"visibility\":\"public\",\"name\":\"test-repo-visibility-public\"}", "ignoreArrayOrder": true, "ignoreExtraElements": false } @@ -22,23 +22,23 @@ "bodyFileName": "orgs_hub4j-test-org_repos-3.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:18:55 GMT", + "Date": "Thu, 10 Aug 2023 07:45:45 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "\"4ea5f7ebb6870742d7ef1111f061ebf5aa8c3d166dea426dd056327874e5e668\"", + "ETag": "\"19a77460c5594380eda8af4882b0a71fc41409f1fa4ff9850497b878ab13460a\"", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "public_repo, repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; param=nebula-preview; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4932", - "X-RateLimit-Reset": "1691653436", - "X-RateLimit-Used": "68", + "X-RateLimit-Remaining": "4986", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "14", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -48,11 +48,11 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "A971:0F26:BB81279:BD37464:64D48F5E", - "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility" + "X-GitHub-Request-Id": "9CDF:B69B:5A92D31:5B7A0B2:64D495A8", + "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public" } }, - "uuid": "e5597307-486b-4d27-8cf2-39ebbf502cee", + "uuid": "188bae51-0c10-4be0-b3c6-eb6b45414866", "persistent": true, "insertionIndex": 3 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json index b0860a2227..62d46f4be7 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json @@ -1,5 +1,5 @@ { - "id": "2e1e4794-5963-433b-8980-5e367513ca6d", + "id": "441afa80-e0e5-4129-89d0-c92e51989bc9", "name": "orgs_hub4j-test-org_repos", "request": { "url": "/orgs/hub4j-test-org/repos", @@ -11,7 +11,7 @@ }, "bodyPatterns": [ { - "equalToJson": "{\"visibility\":\"private\",\"name\":\"test-repo-visibility\"}", + "equalToJson": "{\"visibility\":\"private\",\"name\":\"test-repo-visibility-private\"}", "ignoreArrayOrder": true, "ignoreExtraElements": false } @@ -22,23 +22,23 @@ "bodyFileName": "orgs_hub4j-test-org_repos-6.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:18:57 GMT", + "Date": "Thu, 10 Aug 2023 07:45:48 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "\"ea08c68306302e0e4f696330043eb2cfa4903411fec5ce2cbc4adff2f7e51d73\"", + "ETag": "\"ba35db22430b43911c102b0625b39cbe47898d6acc904c27d098a05f85e41cad\"", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "public_repo, repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; param=nebula-preview; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4929", - "X-RateLimit-Reset": "1691653436", - "X-RateLimit-Used": "71", + "X-RateLimit-Remaining": "4983", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "17", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -48,11 +48,11 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "5C8D:1B9A:A1DF6A4:A369045:64D48F60", - "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility" + "X-GitHub-Request-Id": "E8F6:A754:713834:72868E:64D495AA", + "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private" } }, - "uuid": "2e1e4794-5963-433b-8980-5e367513ca6d", + "uuid": "441afa80-e0e5-4129-89d0-c92e51989bc9", "persistent": true, "insertionIndex": 6 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json similarity index 68% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-7.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json index 4732254953..46aefd139f 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-7.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json @@ -1,8 +1,8 @@ { - "id": "0f5b7d83-b28a-4539-9049-c34239fd494e", - "name": "repos_hub4j-test-org_test-repo-visibility", + "id": "cf349c3f-93df-4573-a5b3-0a2d81c0ceb2", + "name": "repos_hub4j-test-org_test-repo-visibility-private", "request": { - "url": "/repos/hub4j-test-org/test-repo-visibility", + "url": "/repos/hub4j-test-org/test-repo-visibility-private", "method": "GET", "headers": { "Accept": { @@ -12,27 +12,27 @@ }, "response": { "status": 200, - "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-7.json", + "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-private-7.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:18:57 GMT", + "Date": "Thu, 10 Aug 2023 07:45:48 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"b07ffdafba20cf8f8f4100797f4be0428989dfe0fff6bdc2b7746e4960194765\"", - "Last-Modified": "Thu, 10 Aug 2023 07:18:56 GMT", + "ETag": "W/\"9689bec30e75dd8fa20cae6d158ab9ccd53a5d7a390201deb6bd97b3b16b4787\"", + "Last-Modified": "Thu, 10 Aug 2023 07:45:47 GMT", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4928", - "X-RateLimit-Reset": "1691653436", - "X-RateLimit-Used": "72", + "X-RateLimit-Remaining": "4982", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "18", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -42,12 +42,10 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "E8ED:6CA9:4A1AAE3:4ACB8CA:64D48F61" + "X-GitHub-Request-Id": "92F1:F011:BD4F833:BF08CA6:64D495AC" } }, - "uuid": "0f5b7d83-b28a-4539-9049-c34239fd494e", + "uuid": "cf349c3f-93df-4573-a5b3-0a2d81c0ceb2", "persistent": true, - "scenarioName": "scenario-1-repos-hub4j-test-org-test-repo-visibility", - "requiredScenarioState": "scenario-1-repos-hub4j-test-org-test-repo-visibility-2", "insertionIndex": 7 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-8.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json similarity index 73% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-8.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json index 1e08f65f57..9b398d0116 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-8.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json @@ -1,8 +1,8 @@ { - "id": "6d7050e5-ee36-4656-b4c2-f2e78d6f136d", - "name": "repos_hub4j-test-org_test-repo-visibility", + "id": "07317a7b-a4da-49c4-b557-2e90dc905ff1", + "name": "repos_hub4j-test-org_test-repo-visibility-private", "request": { - "url": "/repos/hub4j-test-org/test-repo-visibility", + "url": "/repos/hub4j-test-org/test-repo-visibility-private", "method": "DELETE", "headers": { "Accept": { @@ -14,16 +14,16 @@ "status": 204, "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:18:58 GMT", + "Date": "Thu, 10 Aug 2023 07:45:49 GMT", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4927", - "X-RateLimit-Reset": "1691653436", - "X-RateLimit-Used": "73", + "X-RateLimit-Remaining": "4981", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "19", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -34,12 +34,10 @@ "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "A440:73C9:B7F5020:B9AB131:64D48F61" + "X-GitHub-Request-Id": "102F:AC85:BB2EF5B:BCE8325:64D495AC" } }, - "uuid": "6d7050e5-ee36-4656-b4c2-f2e78d6f136d", + "uuid": "07317a7b-a4da-49c4-b557-2e90dc905ff1", "persistent": true, - "scenarioName": "scenario-2-repos-hub4j-test-org-test-repo-visibility", - "requiredScenarioState": "scenario-2-repos-hub4j-test-org-test-repo-visibility-2", "insertionIndex": 8 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json similarity index 68% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-4.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json index 31f73aa515..b432ba2998 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-4.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json @@ -1,8 +1,8 @@ { - "id": "f92bb19d-814a-41aa-b33a-2d46b6854431", - "name": "repos_hub4j-test-org_test-repo-visibility", + "id": "da35c0a6-22b5-4be6-bf79-a8554f147a58", + "name": "repos_hub4j-test-org_test-repo-visibility-public", "request": { - "url": "/repos/hub4j-test-org/test-repo-visibility", + "url": "/repos/hub4j-test-org/test-repo-visibility-public", "method": "GET", "headers": { "Accept": { @@ -12,27 +12,27 @@ }, "response": { "status": 200, - "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-4.json", + "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-public-4.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:18:55 GMT", + "Date": "Thu, 10 Aug 2023 07:45:46 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"c0bbd645a3cd754b7cd39d3ab2d8f9ac24bd528a0092e6fc4a6edfd8012950f8\"", - "Last-Modified": "Thu, 10 Aug 2023 07:18:54 GMT", + "ETag": "W/\"4d970454ee57b9316655cc27c83c6a4e2e7065a181eac3980b86dd5e794e5e68\"", + "Last-Modified": "Thu, 10 Aug 2023 07:45:45 GMT", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4931", - "X-RateLimit-Reset": "1691653436", - "X-RateLimit-Used": "69", + "X-RateLimit-Remaining": "4985", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "15", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -42,13 +42,10 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "A1F5:0BF2:C07804F:C22E2AA:64D48F5F" + "X-GitHub-Request-Id": "A149:F85B:BB0A961:BCC3D0F:64D495A9" } }, - "uuid": "f92bb19d-814a-41aa-b33a-2d46b6854431", + "uuid": "da35c0a6-22b5-4be6-bf79-a8554f147a58", "persistent": true, - "scenarioName": "scenario-1-repos-hub4j-test-org-test-repo-visibility", - "requiredScenarioState": "Started", - "newScenarioState": "scenario-1-repos-hub4j-test-org-test-repo-visibility-2", "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json similarity index 72% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-5.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json index 21626ebac6..809a51de8f 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-5.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json @@ -1,8 +1,8 @@ { - "id": "55176ff0-c55c-4020-8bb4-cc6ad6ce9a15", - "name": "repos_hub4j-test-org_test-repo-visibility", + "id": "2fd53ed1-984b-4fc0-9791-60116c744823", + "name": "repos_hub4j-test-org_test-repo-visibility-public", "request": { - "url": "/repos/hub4j-test-org/test-repo-visibility", + "url": "/repos/hub4j-test-org/test-repo-visibility-public", "method": "DELETE", "headers": { "Accept": { @@ -14,16 +14,16 @@ "status": 204, "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:18:56 GMT", + "Date": "Thu, 10 Aug 2023 07:45:46 GMT", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "delete_repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4930", - "X-RateLimit-Reset": "1691653436", - "X-RateLimit-Used": "70", + "X-RateLimit-Remaining": "4984", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "16", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -34,13 +34,10 @@ "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "C272:1B9A:A1DF4E9:A368E72:64D48F5F" + "X-GitHub-Request-Id": "4C6D:E0BE:39AF5F5:3A4072B:64D495AA" } }, - "uuid": "55176ff0-c55c-4020-8bb4-cc6ad6ce9a15", + "uuid": "2fd53ed1-984b-4fc0-9791-60116c744823", "persistent": true, - "scenarioName": "scenario-2-repos-hub4j-test-org-test-repo-visibility", - "requiredScenarioState": "Started", - "newScenarioState": "scenario-2-repos-hub4j-test-org-test-repo-visibility-2", "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json index 857b160cae..c2c8c38725 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json @@ -1,5 +1,5 @@ { - "id": "daa90f97-80a4-4363-b491-e1395dd797c6", + "id": "9cdf5d36-de1c-486b-aad1-6d6919a9d62a", "name": "user", "request": { "url": "/user", @@ -15,7 +15,7 @@ "bodyFileName": "user-1.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:18:53 GMT", + "Date": "Thu, 10 Aug 2023 07:45:43 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ @@ -30,9 +30,9 @@ "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4935", - "X-RateLimit-Reset": "1691653436", - "X-RateLimit-Used": "65", + "X-RateLimit-Remaining": "4989", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "11", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -42,10 +42,10 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "B79A:AC85:B981BF3:BB37DAE:64D48F5D" + "X-GitHub-Request-Id": "F289:1B9A:A37A4A4:A507038:64D495A7" } }, - "uuid": "daa90f97-80a4-4363-b491-e1395dd797c6", + "uuid": "9cdf5d36-de1c-486b-aad1-6d6919a9d62a", "persistent": true, "insertionIndex": 1 } \ No newline at end of file From f4322fe0af26b1ec23bc34205354da339f535c35 Mon Sep 17 00:00:00 2001 From: "Baur Daniel (HAU-ITE)" Date: Thu, 10 Aug 2023 10:18:01 +0200 Subject: [PATCH 5/5] also add tests for user perspective --- .../org/kohsuke/github/GHRepositoryTest.java | 32 ++++- .../__files/orgs_hub4j-test-org-2.json | 0 .../__files/orgs_hub4j-test-org_repos-3.json | 12 +- .../__files/orgs_hub4j-test-org_repos-6.json | 12 +- ...st-org_test-repo-visibility-private-7.json | 14 +- ...est-org_test-repo-visibility-public-4.json | 12 +- .../__files/user-1.json | 0 .../mappings/orgs_hub4j-test-org-2.json | 12 +- .../mappings/orgs_hub4j-test-org_repos-3.json | 14 +- .../mappings/orgs_hub4j-test-org_repos-6.json | 14 +- ...st-org_test-repo-visibility-private-7.json | 16 +-- ...st-org_test-repo-visibility-private-8.json | 12 +- ...est-org_test-repo-visibility-public-4.json | 16 +-- ...est-org_test-repo-visibility-public-5.json | 12 +- .../mappings/user-1.json | 12 +- ..._dbaur_test-repo-visibility-private-3.json | 121 ++++++++++++++++ ...s_dbaur_test-repo-visibility-public-6.json | 132 ++++++++++++++++++ .../__files/user-1.json | 46 ++++++ .../__files/user_repos-2.json | 120 ++++++++++++++++ .../__files/user_repos-5.json | 120 ++++++++++++++++ ..._dbaur_test-repo-visibility-private-3.json | 51 +++++++ ..._dbaur_test-repo-visibility-private-4.json | 43 ++++++ ...s_dbaur_test-repo-visibility-public-6.json | 51 +++++++ ...s_dbaur_test-repo-visibility-public-7.json | 43 ++++++ .../mappings/user-1.json | 51 +++++++ .../mappings/user_repos-2.json | 58 ++++++++ .../mappings/user_repos-5.json | 58 ++++++++ 27 files changed, 1003 insertions(+), 81 deletions(-) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/__files/orgs_hub4j-test-org-2.json (100%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/__files/orgs_hub4j-test-org_repos-3.json (97%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/__files/orgs_hub4j-test-org_repos-6.json (97%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json (97%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json (97%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/__files/user-1.json (100%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/mappings/orgs_hub4j-test-org-2.json (88%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/mappings/orgs_hub4j-test-org_repos-3.json (86%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/mappings/orgs_hub4j-test-org_repos-6.json (86%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json (82%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json (86%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json (82%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json (86%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetVisibility => testCreateVisibilityForOrganization}/mappings/user-1.json (87%) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/repos_dbaur_test-repo-visibility-private-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/repos_dbaur_test-repo-visibility-public-6.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user_repos-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user_repos-5.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-private-3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-private-4.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-public-6.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-public-7.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user-1.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user_repos-2.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user_repos-5.json diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 02ba5bf7aa..d0ff0f73e1 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -312,13 +312,13 @@ public void testSetPublic() throws Exception { } /** - * Tests the creation of repositories with alternating visibilities. + * Tests the creation of repositories with alternating visibilities for orgs. * * @throws Exception * the exception */ @Test - public void testSetVisibility() throws Exception { + public void testCreateVisibilityForOrganization() throws Exception { GHOrganization organization = gitHub.getOrganization(GITHUB_API_TEST_ORG); // can not test for internal, as test org is not assigned to an enterprise @@ -334,6 +334,34 @@ public void testSetVisibility() throws Exception { } } + /** + * Tests the creation of repositories with alternating visibilities for users. + * + * @throws Exception + * the exception + */ + @Test + public void testCreateVisibilityForUser() throws Exception { + + GHUser myself = gitHub.getMyself(); + + // can not test for internal, as test org is not assigned to an enterprise + for (Visibility visibility : Sets.newHashSet(Visibility.PUBLIC, Visibility.PRIVATE)) { + String repoName = String.format("test-repo-visibility-%s", visibility.toString()); + boolean isPrivate = visibility.equals(Visibility.PRIVATE); + GHRepository repository = gitHub.createRepository(repoName) + .private_(isPrivate) + .visibility(visibility) + .create(); + try { + assertThat(repository.getVisibility(), is(visibility)); + assertThat(myself.getRepository(repoName).getVisibility(), is(visibility)); + } finally { + repository.delete(); + } + } + } + /** * Test update repository. * diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org-2.json similarity index 100% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org-2.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org-2.json diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org_repos-3.json similarity index 97% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org_repos-3.json index 1875e8cf1e..41aefbcfbe 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org_repos-3.json @@ -1,6 +1,6 @@ { - "id": 676869680, - "node_id": "R_kgDOKFg2MA", + "id": 676879845, + "node_id": "R_kgDOKFhd5Q", "name": "test-repo-visibility-public", "full_name": "hub4j-test-org/test-repo-visibility-public", "private": false, @@ -64,9 +64,9 @@ "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/labels{/name}", "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/deployments", - "created_at": "2023-08-10T07:45:44Z", - "updated_at": "2023-08-10T07:45:45Z", - "pushed_at": "2023-08-10T07:45:45Z", + "created_at": "2023-08-10T08:16:45Z", + "updated_at": "2023-08-10T08:16:46Z", + "pushed_at": "2023-08-10T08:16:46Z", "git_url": "git://github.com/hub4j-test-org/test-repo-visibility-public.git", "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility-public.git", "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility-public.git", @@ -136,5 +136,5 @@ "site_admin": false }, "network_count": 0, - "subscribers_count": 3 + "subscribers_count": 0 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org_repos-6.json similarity index 97% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org_repos-6.json index 5496625969..41e08d8c90 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/orgs_hub4j-test-org_repos-6.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org_repos-6.json @@ -1,6 +1,6 @@ { - "id": 676869689, - "node_id": "R_kgDOKFg2OQ", + "id": 676879862, + "node_id": "R_kgDOKFhd9g", "name": "test-repo-visibility-private", "full_name": "hub4j-test-org/test-repo-visibility-private", "private": true, @@ -64,9 +64,9 @@ "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/labels{/name}", "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/deployments", - "created_at": "2023-08-10T07:45:47Z", - "updated_at": "2023-08-10T07:45:47Z", - "pushed_at": "2023-08-10T07:45:47Z", + "created_at": "2023-08-10T08:16:48Z", + "updated_at": "2023-08-10T08:16:48Z", + "pushed_at": "2023-08-10T08:16:48Z", "git_url": "git://github.com/hub4j-test-org/test-repo-visibility-private.git", "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility-private.git", "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility-private.git", @@ -136,5 +136,5 @@ "site_admin": false }, "network_count": 0, - "subscribers_count": 2 + "subscribers_count": 0 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json similarity index 97% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json index d77b92d3c2..bb8cbae35d 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json @@ -1,6 +1,6 @@ { - "id": 676869689, - "node_id": "R_kgDOKFg2OQ", + "id": 676879862, + "node_id": "R_kgDOKFhd9g", "name": "test-repo-visibility-private", "full_name": "hub4j-test-org/test-repo-visibility-private", "private": true, @@ -64,9 +64,9 @@ "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/labels{/name}", "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private/deployments", - "created_at": "2023-08-10T07:45:47Z", - "updated_at": "2023-08-10T07:45:47Z", - "pushed_at": "2023-08-10T07:45:47Z", + "created_at": "2023-08-10T08:16:48Z", + "updated_at": "2023-08-10T08:16:48Z", + "pushed_at": "2023-08-10T08:16:48Z", "git_url": "git://github.com/hub4j-test-org/test-repo-visibility-private.git", "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility-private.git", "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility-private.git", @@ -104,7 +104,7 @@ "triage": true, "pull": true }, - "temp_clone_token": "ABXKPQBITLCODHOOYTH5CXTE2SLNQ", + "temp_clone_token": "ABXKPQCKFTRVIO2CU2TP4TLE2SPB2", "allow_squash_merge": true, "allow_merge_commit": true, "allow_rebase_merge": true, @@ -137,5 +137,5 @@ "site_admin": false }, "network_count": 0, - "subscribers_count": 8 + "subscribers_count": 7 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json similarity index 97% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json index 3ab9635eba..18bc5c5494 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json @@ -1,6 +1,6 @@ { - "id": 676869680, - "node_id": "R_kgDOKFg2MA", + "id": 676879845, + "node_id": "R_kgDOKFhd5Q", "name": "test-repo-visibility-public", "full_name": "hub4j-test-org/test-repo-visibility-public", "private": false, @@ -64,9 +64,9 @@ "labels_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/labels{/name}", "releases_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/releases{/id}", "deployments_url": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public/deployments", - "created_at": "2023-08-10T07:45:44Z", - "updated_at": "2023-08-10T07:45:45Z", - "pushed_at": "2023-08-10T07:45:45Z", + "created_at": "2023-08-10T08:16:45Z", + "updated_at": "2023-08-10T08:16:46Z", + "pushed_at": "2023-08-10T08:16:46Z", "git_url": "git://github.com/hub4j-test-org/test-repo-visibility-public.git", "ssh_url": "git@github.com:hub4j-test-org/test-repo-visibility-public.git", "clone_url": "https://github.com/hub4j-test-org/test-repo-visibility-public.git", @@ -148,5 +148,5 @@ } }, "network_count": 0, - "subscribers_count": 14 + "subscribers_count": 7 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/user-1.json similarity index 100% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/__files/user-1.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/user-1.json diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org-2.json similarity index 88% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org-2.json index a5db5e17e4..8246f6c638 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org-2.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org-2.json @@ -1,5 +1,5 @@ { - "id": "6a53a088-20f1-4c0c-b7cf-0aa8d1d974e2", + "id": "11b5a503-81c8-4c75-86f4-29aece672ca5", "name": "orgs_hub4j-test-org", "request": { "url": "/orgs/hub4j-test-org", @@ -15,7 +15,7 @@ "bodyFileName": "orgs_hub4j-test-org-2.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:45:44 GMT", + "Date": "Thu, 10 Aug 2023 08:16:45 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ @@ -30,9 +30,9 @@ "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4987", + "X-RateLimit-Remaining": "4966", "X-RateLimit-Reset": "1691657047", - "X-RateLimit-Used": "13", + "X-RateLimit-Used": "34", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -42,10 +42,10 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "2EA5:E1BB:82E0A26:84107E1:64D495A8" + "X-GitHub-Request-Id": "6DDB:0BF2:C43B083:C5F7EA0:64D49CED" } }, - "uuid": "6a53a088-20f1-4c0c-b7cf-0aa8d1d974e2", + "uuid": "11b5a503-81c8-4c75-86f4-29aece672ca5", "persistent": true, "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org_repos-3.json similarity index 86% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org_repos-3.json index 212e772560..c7472e4f1c 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-3.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org_repos-3.json @@ -1,5 +1,5 @@ { - "id": "188bae51-0c10-4be0-b3c6-eb6b45414866", + "id": "dd68d6f4-8604-4fa1-8b3e-60008b2641d7", "name": "orgs_hub4j-test-org_repos", "request": { "url": "/orgs/hub4j-test-org/repos", @@ -22,23 +22,23 @@ "bodyFileName": "orgs_hub4j-test-org_repos-3.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:45:45 GMT", + "Date": "Thu, 10 Aug 2023 08:16:46 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "\"19a77460c5594380eda8af4882b0a71fc41409f1fa4ff9850497b878ab13460a\"", + "ETag": "\"a4022eacf3610f0af2727fe90fd92727d52c233a2d0498987687f85402ada84f\"", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "public_repo, repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; param=nebula-preview; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4986", + "X-RateLimit-Remaining": "4965", "X-RateLimit-Reset": "1691657047", - "X-RateLimit-Used": "14", + "X-RateLimit-Used": "35", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -48,11 +48,11 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "9CDF:B69B:5A92D31:5B7A0B2:64D495A8", + "X-GitHub-Request-Id": "FD12:37FF:A0FD881:A27FB32:64D49CED", "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public" } }, - "uuid": "188bae51-0c10-4be0-b3c6-eb6b45414866", + "uuid": "dd68d6f4-8604-4fa1-8b3e-60008b2641d7", "persistent": true, "insertionIndex": 3 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org_repos-6.json similarity index 86% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org_repos-6.json index 62d46f4be7..3150934e45 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/orgs_hub4j-test-org_repos-6.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org_repos-6.json @@ -1,5 +1,5 @@ { - "id": "441afa80-e0e5-4129-89d0-c92e51989bc9", + "id": "4b47fb90-5073-413d-88fb-15e372883c5b", "name": "orgs_hub4j-test-org_repos", "request": { "url": "/orgs/hub4j-test-org/repos", @@ -22,23 +22,23 @@ "bodyFileName": "orgs_hub4j-test-org_repos-6.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:45:48 GMT", + "Date": "Thu, 10 Aug 2023 08:16:48 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "\"ba35db22430b43911c102b0625b39cbe47898d6acc904c27d098a05f85e41cad\"", + "ETag": "\"afbff3bbcc1fcbc9034fef2ae0c7ad185f86e13387630f1e50bf282f86cd7eb5\"", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "public_repo, repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; param=nebula-preview; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4983", + "X-RateLimit-Remaining": "4962", "X-RateLimit-Reset": "1691657047", - "X-RateLimit-Used": "17", + "X-RateLimit-Used": "38", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -48,11 +48,11 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "E8F6:A754:713834:72868E:64D495AA", + "X-GitHub-Request-Id": "B4B1:3986:C5D9B60:C79698A:64D49CEF", "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private" } }, - "uuid": "441afa80-e0e5-4129-89d0-c92e51989bc9", + "uuid": "4b47fb90-5073-413d-88fb-15e372883c5b", "persistent": true, "insertionIndex": 6 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json similarity index 82% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json index 46aefd139f..f7270bb819 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json @@ -1,5 +1,5 @@ { - "id": "cf349c3f-93df-4573-a5b3-0a2d81c0ceb2", + "id": "540eae50-8e68-4a09-bc7e-44a345ca05ac", "name": "repos_hub4j-test-org_test-repo-visibility-private", "request": { "url": "/repos/hub4j-test-org/test-repo-visibility-private", @@ -15,24 +15,24 @@ "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-private-7.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:45:48 GMT", + "Date": "Thu, 10 Aug 2023 08:16:49 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"9689bec30e75dd8fa20cae6d158ab9ccd53a5d7a390201deb6bd97b3b16b4787\"", - "Last-Modified": "Thu, 10 Aug 2023 07:45:47 GMT", + "ETag": "W/\"9e0ca2fa3644d8f9ad2c77c331c32fb2b6142a08142217835d2dc50818ed9763\"", + "Last-Modified": "Thu, 10 Aug 2023 08:16:48 GMT", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4982", + "X-RateLimit-Remaining": "4961", "X-RateLimit-Reset": "1691657047", - "X-RateLimit-Used": "18", + "X-RateLimit-Used": "39", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -42,10 +42,10 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "92F1:F011:BD4F833:BF08CA6:64D495AC" + "X-GitHub-Request-Id": "6FC8:0628:C18DB8F:C34AA1D:64D49CF1" } }, - "uuid": "cf349c3f-93df-4573-a5b3-0a2d81c0ceb2", + "uuid": "540eae50-8e68-4a09-bc7e-44a345ca05ac", "persistent": true, "insertionIndex": 7 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json similarity index 86% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json index 9b398d0116..0cdae38823 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json @@ -1,5 +1,5 @@ { - "id": "07317a7b-a4da-49c4-b557-2e90dc905ff1", + "id": "62ddd6fd-995a-48e9-80c5-778d276da598", "name": "repos_hub4j-test-org_test-repo-visibility-private", "request": { "url": "/repos/hub4j-test-org/test-repo-visibility-private", @@ -14,16 +14,16 @@ "status": 204, "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:45:49 GMT", + "Date": "Thu, 10 Aug 2023 08:16:49 GMT", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4981", + "X-RateLimit-Remaining": "4960", "X-RateLimit-Reset": "1691657047", - "X-RateLimit-Used": "19", + "X-RateLimit-Used": "40", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -34,10 +34,10 @@ "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "102F:AC85:BB2EF5B:BCE8325:64D495AC" + "X-GitHub-Request-Id": "3ECF:107D4:BA2781C:BBE45B6:64D49CF1" } }, - "uuid": "07317a7b-a4da-49c4-b557-2e90dc905ff1", + "uuid": "62ddd6fd-995a-48e9-80c5-778d276da598", "persistent": true, "insertionIndex": 8 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json similarity index 82% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json index b432ba2998..ce2cd062bc 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json @@ -1,5 +1,5 @@ { - "id": "da35c0a6-22b5-4be6-bf79-a8554f147a58", + "id": "056ca96a-7c6c-4063-b832-091c1711a625", "name": "repos_hub4j-test-org_test-repo-visibility-public", "request": { "url": "/repos/hub4j-test-org/test-repo-visibility-public", @@ -15,24 +15,24 @@ "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-public-4.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:45:46 GMT", + "Date": "Thu, 10 Aug 2023 08:16:47 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With" ], - "ETag": "W/\"4d970454ee57b9316655cc27c83c6a4e2e7065a181eac3980b86dd5e794e5e68\"", - "Last-Modified": "Thu, 10 Aug 2023 07:45:45 GMT", + "ETag": "W/\"424a290a1bc05597231646d41563213026e71b1b0b9f96fb9017ca534cbc5b81\"", + "Last-Modified": "Thu, 10 Aug 2023 08:16:46 GMT", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4985", + "X-RateLimit-Remaining": "4964", "X-RateLimit-Reset": "1691657047", - "X-RateLimit-Used": "15", + "X-RateLimit-Used": "36", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -42,10 +42,10 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "A149:F85B:BB0A961:BCC3D0F:64D495A9" + "X-GitHub-Request-Id": "5FFB:392E:BB82EAB:BD3FBC1:64D49CEE" } }, - "uuid": "da35c0a6-22b5-4be6-bf79-a8554f147a58", + "uuid": "056ca96a-7c6c-4063-b832-091c1711a625", "persistent": true, "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json similarity index 86% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json index 809a51de8f..84ecb2d295 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json @@ -1,5 +1,5 @@ { - "id": "2fd53ed1-984b-4fc0-9791-60116c744823", + "id": "48ed2e59-9b57-4b8f-99f8-10046d9fb104", "name": "repos_hub4j-test-org_test-repo-visibility-public", "request": { "url": "/repos/hub4j-test-org/test-repo-visibility-public", @@ -14,16 +14,16 @@ "status": 204, "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:45:46 GMT", + "Date": "Thu, 10 Aug 2023 08:16:47 GMT", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", "X-Accepted-OAuth-Scopes": "delete_repo", "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4984", + "X-RateLimit-Remaining": "4963", "X-RateLimit-Reset": "1691657047", - "X-RateLimit-Used": "16", + "X-RateLimit-Used": "37", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -34,10 +34,10 @@ "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", "Vary": "Accept-Encoding, Accept, X-Requested-With", - "X-GitHub-Request-Id": "4C6D:E0BE:39AF5F5:3A4072B:64D495AA" + "X-GitHub-Request-Id": "98FD:392E:BB830AB:BD3FDC3:64D49CEF" } }, - "uuid": "2fd53ed1-984b-4fc0-9791-60116c744823", + "uuid": "48ed2e59-9b57-4b8f-99f8-10046d9fb104", "persistent": true, "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/user-1.json similarity index 87% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/user-1.json index c2c8c38725..adecd246e5 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetVisibility/mappings/user-1.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/user-1.json @@ -1,5 +1,5 @@ { - "id": "9cdf5d36-de1c-486b-aad1-6d6919a9d62a", + "id": "615f57b7-baf3-473d-ab53-7b9c378c826f", "name": "user", "request": { "url": "/user", @@ -15,7 +15,7 @@ "bodyFileName": "user-1.json", "headers": { "Server": "GitHub.com", - "Date": "Thu, 10 Aug 2023 07:45:43 GMT", + "Date": "Thu, 10 Aug 2023 08:16:44 GMT", "Content-Type": "application/json; charset=utf-8", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ @@ -30,9 +30,9 @@ "X-GitHub-Media-Type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4989", + "X-RateLimit-Remaining": "4968", "X-RateLimit-Reset": "1691657047", - "X-RateLimit-Used": "11", + "X-RateLimit-Used": "32", "X-RateLimit-Resource": "core", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "Access-Control-Allow-Origin": "*", @@ -42,10 +42,10 @@ "X-XSS-Protection": "0", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "F289:1B9A:A37A4A4:A507038:64D495A7" + "X-GitHub-Request-Id": "5300:6CA9:4DBF50F:4E76E9C:64D49CEC" } }, - "uuid": "9cdf5d36-de1c-486b-aad1-6d6919a9d62a", + "uuid": "615f57b7-baf3-473d-ab53-7b9c378c826f", "persistent": true, "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/repos_dbaur_test-repo-visibility-private-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/repos_dbaur_test-repo-visibility-private-3.json new file mode 100644 index 0000000000..41639b5477 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/repos_dbaur_test-repo-visibility-private-3.json @@ -0,0 +1,121 @@ +{ + "id": 676880054, + "node_id": "R_kgDOKFhetg", + "name": "test-repo-visibility-private", + "full_name": "dbaur/test-repo-visibility-private", + "private": true, + "owner": { + "login": "dbaur", + "id": 7251904, + "node_id": "MDQ6VXNlcjcyNTE5MDQ=", + "avatar_url": "https://avatars.githubusercontent.com/u/7251904?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dbaur", + "html_url": "https://github.com/dbaur", + "followers_url": "https://api.github.com/users/dbaur/followers", + "following_url": "https://api.github.com/users/dbaur/following{/other_user}", + "gists_url": "https://api.github.com/users/dbaur/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dbaur/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dbaur/subscriptions", + "organizations_url": "https://api.github.com/users/dbaur/orgs", + "repos_url": "https://api.github.com/users/dbaur/repos", + "events_url": "https://api.github.com/users/dbaur/events{/privacy}", + "received_events_url": "https://api.github.com/users/dbaur/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/dbaur/test-repo-visibility-private", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/dbaur/test-repo-visibility-private", + "forks_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/forks", + "keys_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/teams", + "hooks_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/hooks", + "issue_events_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/issues/events{/number}", + "events_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/events", + "assignees_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/assignees{/user}", + "branches_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/branches{/branch}", + "tags_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/tags", + "blobs_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/statuses/{sha}", + "languages_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/languages", + "stargazers_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/stargazers", + "contributors_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/contributors", + "subscribers_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/subscribers", + "subscription_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/subscription", + "commits_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/contents/{+path}", + "compare_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/merges", + "archive_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/downloads", + "issues_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/issues{/number}", + "pulls_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/pulls{/number}", + "milestones_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/milestones{/number}", + "notifications_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/labels{/name}", + "releases_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/releases{/id}", + "deployments_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/deployments", + "created_at": "2023-08-10T08:17:17Z", + "updated_at": "2023-08-10T08:17:18Z", + "pushed_at": "2023-08-10T08:17:18Z", + "git_url": "git://github.com/dbaur/test-repo-visibility-private.git", + "ssh_url": "git@github.com:dbaur/test-repo-visibility-private.git", + "clone_url": "https://github.com/dbaur/test-repo-visibility-private.git", + "svn_url": "https://github.com/dbaur/test-repo-visibility-private", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "ABXKPQGUT6WEMKJU3O23ISDE2SPDU", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "network_count": 0, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/repos_dbaur_test-repo-visibility-public-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/repos_dbaur_test-repo-visibility-public-6.json new file mode 100644 index 0000000000..b160d1fc85 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/repos_dbaur_test-repo-visibility-public-6.json @@ -0,0 +1,132 @@ +{ + "id": 676880069, + "node_id": "R_kgDOKFhexQ", + "name": "test-repo-visibility-public", + "full_name": "dbaur/test-repo-visibility-public", + "private": false, + "owner": { + "login": "dbaur", + "id": 7251904, + "node_id": "MDQ6VXNlcjcyNTE5MDQ=", + "avatar_url": "https://avatars.githubusercontent.com/u/7251904?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dbaur", + "html_url": "https://github.com/dbaur", + "followers_url": "https://api.github.com/users/dbaur/followers", + "following_url": "https://api.github.com/users/dbaur/following{/other_user}", + "gists_url": "https://api.github.com/users/dbaur/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dbaur/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dbaur/subscriptions", + "organizations_url": "https://api.github.com/users/dbaur/orgs", + "repos_url": "https://api.github.com/users/dbaur/repos", + "events_url": "https://api.github.com/users/dbaur/events{/privacy}", + "received_events_url": "https://api.github.com/users/dbaur/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/dbaur/test-repo-visibility-public", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/dbaur/test-repo-visibility-public", + "forks_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/forks", + "keys_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/teams", + "hooks_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/hooks", + "issue_events_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/issues/events{/number}", + "events_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/events", + "assignees_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/assignees{/user}", + "branches_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/branches{/branch}", + "tags_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/tags", + "blobs_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/statuses/{sha}", + "languages_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/languages", + "stargazers_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/stargazers", + "contributors_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/contributors", + "subscribers_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/subscribers", + "subscription_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/subscription", + "commits_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/contents/{+path}", + "compare_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/merges", + "archive_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/downloads", + "issues_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/issues{/number}", + "pulls_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/pulls{/number}", + "milestones_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/milestones{/number}", + "notifications_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/labels{/name}", + "releases_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/releases{/id}", + "deployments_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/deployments", + "created_at": "2023-08-10T08:17:20Z", + "updated_at": "2023-08-10T08:17:20Z", + "pushed_at": "2023-08-10T08:17:20Z", + "git_url": "git://github.com/dbaur/test-repo-visibility-public.git", + "ssh_url": "git@github.com:dbaur/test-repo-visibility-public.git", + "clone_url": "https://github.com/dbaur/test-repo-visibility-public.git", + "svn_url": "https://github.com/dbaur/test-repo-visibility-public", + "homepage": null, + "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, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "security_and_analysis": { + "secret_scanning": { + "status": "disabled" + }, + "secret_scanning_push_protection": { + "status": "disabled" + }, + "dependabot_security_updates": { + "status": "disabled" + } + }, + "network_count": 0, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user-1.json new file mode 100644 index 0000000000..21dc04da7c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user-1.json @@ -0,0 +1,46 @@ +{ + "login": "dbaur", + "id": 7251904, + "node_id": "MDQ6VXNlcjcyNTE5MDQ=", + "avatar_url": "https://avatars.githubusercontent.com/u/7251904?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dbaur", + "html_url": "https://github.com/dbaur", + "followers_url": "https://api.github.com/users/dbaur/followers", + "following_url": "https://api.github.com/users/dbaur/following{/other_user}", + "gists_url": "https://api.github.com/users/dbaur/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dbaur/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dbaur/subscriptions", + "organizations_url": "https://api.github.com/users/dbaur/orgs", + "repos_url": "https://api.github.com/users/dbaur/repos", + "events_url": "https://api.github.com/users/dbaur/events{/privacy}", + "received_events_url": "https://api.github.com/users/dbaur/received_events", + "type": "User", + "site_admin": false, + "name": "Daniel Baur", + "company": null, + "blog": "", + "location": "Ulm", + "email": null, + "hireable": null, + "bio": null, + "twitter_username": null, + "public_repos": 50, + "public_gists": 0, + "followers": 7, + "following": 10, + "created_at": "2014-04-10T14:14:43Z", + "updated_at": "2023-07-28T11:30:28Z", + "private_gists": 3, + "total_private_repos": 13, + "owned_private_repos": 13, + "disk_usage": 104958, + "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/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user_repos-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user_repos-2.json new file mode 100644 index 0000000000..5775ce95ae --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user_repos-2.json @@ -0,0 +1,120 @@ +{ + "id": 676880054, + "node_id": "R_kgDOKFhetg", + "name": "test-repo-visibility-private", + "full_name": "dbaur/test-repo-visibility-private", + "private": true, + "owner": { + "login": "dbaur", + "id": 7251904, + "node_id": "MDQ6VXNlcjcyNTE5MDQ=", + "avatar_url": "https://avatars.githubusercontent.com/u/7251904?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dbaur", + "html_url": "https://github.com/dbaur", + "followers_url": "https://api.github.com/users/dbaur/followers", + "following_url": "https://api.github.com/users/dbaur/following{/other_user}", + "gists_url": "https://api.github.com/users/dbaur/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dbaur/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dbaur/subscriptions", + "organizations_url": "https://api.github.com/users/dbaur/orgs", + "repos_url": "https://api.github.com/users/dbaur/repos", + "events_url": "https://api.github.com/users/dbaur/events{/privacy}", + "received_events_url": "https://api.github.com/users/dbaur/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/dbaur/test-repo-visibility-private", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/dbaur/test-repo-visibility-private", + "forks_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/forks", + "keys_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/teams", + "hooks_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/hooks", + "issue_events_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/issues/events{/number}", + "events_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/events", + "assignees_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/assignees{/user}", + "branches_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/branches{/branch}", + "tags_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/tags", + "blobs_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/statuses/{sha}", + "languages_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/languages", + "stargazers_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/stargazers", + "contributors_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/contributors", + "subscribers_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/subscribers", + "subscription_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/subscription", + "commits_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/contents/{+path}", + "compare_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/merges", + "archive_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/downloads", + "issues_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/issues{/number}", + "pulls_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/pulls{/number}", + "milestones_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/milestones{/number}", + "notifications_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/labels{/name}", + "releases_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/releases{/id}", + "deployments_url": "https://api.github.com/repos/dbaur/test-repo-visibility-private/deployments", + "created_at": "2023-08-10T08:17:17Z", + "updated_at": "2023-08-10T08:17:18Z", + "pushed_at": "2023-08-10T08:17:18Z", + "git_url": "git://github.com/dbaur/test-repo-visibility-private.git", + "ssh_url": "git@github.com:dbaur/test-repo-visibility-private.git", + "clone_url": "https://github.com/dbaur/test-repo-visibility-private.git", + "svn_url": "https://github.com/dbaur/test-repo-visibility-private", + "homepage": null, + "size": 0, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "private", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "network_count": 0, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user_repos-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user_repos-5.json new file mode 100644 index 0000000000..79b5cc4e8b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/__files/user_repos-5.json @@ -0,0 +1,120 @@ +{ + "id": 676880069, + "node_id": "R_kgDOKFhexQ", + "name": "test-repo-visibility-public", + "full_name": "dbaur/test-repo-visibility-public", + "private": false, + "owner": { + "login": "dbaur", + "id": 7251904, + "node_id": "MDQ6VXNlcjcyNTE5MDQ=", + "avatar_url": "https://avatars.githubusercontent.com/u/7251904?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/dbaur", + "html_url": "https://github.com/dbaur", + "followers_url": "https://api.github.com/users/dbaur/followers", + "following_url": "https://api.github.com/users/dbaur/following{/other_user}", + "gists_url": "https://api.github.com/users/dbaur/gists{/gist_id}", + "starred_url": "https://api.github.com/users/dbaur/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/dbaur/subscriptions", + "organizations_url": "https://api.github.com/users/dbaur/orgs", + "repos_url": "https://api.github.com/users/dbaur/repos", + "events_url": "https://api.github.com/users/dbaur/events{/privacy}", + "received_events_url": "https://api.github.com/users/dbaur/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/dbaur/test-repo-visibility-public", + "description": null, + "fork": false, + "url": "https://api.github.com/repos/dbaur/test-repo-visibility-public", + "forks_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/forks", + "keys_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/teams", + "hooks_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/hooks", + "issue_events_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/issues/events{/number}", + "events_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/events", + "assignees_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/assignees{/user}", + "branches_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/branches{/branch}", + "tags_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/tags", + "blobs_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/statuses/{sha}", + "languages_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/languages", + "stargazers_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/stargazers", + "contributors_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/contributors", + "subscribers_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/subscribers", + "subscription_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/subscription", + "commits_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/contents/{+path}", + "compare_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/merges", + "archive_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/downloads", + "issues_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/issues{/number}", + "pulls_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/pulls{/number}", + "milestones_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/milestones{/number}", + "notifications_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/labels{/name}", + "releases_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/releases{/id}", + "deployments_url": "https://api.github.com/repos/dbaur/test-repo-visibility-public/deployments", + "created_at": "2023-08-10T08:17:20Z", + "updated_at": "2023-08-10T08:17:20Z", + "pushed_at": "2023-08-10T08:17:20Z", + "git_url": "git://github.com/dbaur/test-repo-visibility-public.git", + "ssh_url": "git@github.com:dbaur/test-repo-visibility-public.git", + "clone_url": "https://github.com/dbaur/test-repo-visibility-public.git", + "svn_url": "https://github.com/dbaur/test-repo-visibility-public", + "homepage": null, + "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, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "allow_auto_merge": false, + "delete_branch_on_merge": false, + "allow_update_branch": false, + "use_squash_pr_title_as_default": false, + "squash_merge_commit_message": "COMMIT_MESSAGES", + "squash_merge_commit_title": "COMMIT_OR_PR_TITLE", + "merge_commit_message": "PR_TITLE", + "merge_commit_title": "MERGE_MESSAGE", + "network_count": 0, + "subscribers_count": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-private-3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-private-3.json new file mode 100644 index 0000000000..184e5309f6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-private-3.json @@ -0,0 +1,51 @@ +{ + "id": "f3be99a7-c7d5-4976-9985-819f1cf7cb89", + "name": "repos_dbaur_test-repo-visibility-private", + "request": { + "url": "/repos/dbaur/test-repo-visibility-private", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_dbaur_test-repo-visibility-private-3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 08:17:19 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"1fcee14c53151014695c16026a070791c42f4b9459c5bf90b496c55f29aa15dc\"", + "Last-Modified": "Thu, 10 Aug 2023 08:17:18 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4956", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "44", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "535F:1B9A:A589168:A7197C8:64D49D0E" + } + }, + "uuid": "f3be99a7-c7d5-4976-9985-819f1cf7cb89", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-private-4.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-private-4.json new file mode 100644 index 0000000000..41ad8b5288 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-private-4.json @@ -0,0 +1,43 @@ +{ + "id": "380be673-7ca3-4c6d-916a-0df603ed0258", + "name": "repos_dbaur_test-repo-visibility-private", + "request": { + "url": "/repos/dbaur/test-repo-visibility-private", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 08:17:19 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4955", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "45", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "18B3:AC85:BD54BD2:BF11A60:64D49D0F" + } + }, + "uuid": "380be673-7ca3-4c6d-916a-0df603ed0258", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-public-6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-public-6.json new file mode 100644 index 0000000000..c11595c6c3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-public-6.json @@ -0,0 +1,51 @@ +{ + "id": "86cbe029-2da6-4e64-a66e-17512214eb88", + "name": "repos_dbaur_test-repo-visibility-public", + "request": { + "url": "/repos/dbaur/test-repo-visibility-public", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_dbaur_test-repo-visibility-public-6.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 08:17:21 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"dbfe4b8a1933fb9ca510ef5152b51f52ed9055c3e732ba712b9c909fffd0b1e2\"", + "Last-Modified": "Thu, 10 Aug 2023 08:17:20 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4953", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "47", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "3F1E:107D4:BA310E4:BBEDF72:64D49D11" + } + }, + "uuid": "86cbe029-2da6-4e64-a66e-17512214eb88", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-public-7.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-public-7.json new file mode 100644 index 0000000000..c3002856ef --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/repos_dbaur_test-repo-visibility-public-7.json @@ -0,0 +1,43 @@ +{ + "id": "7941094b-097c-4538-aa6c-f009d286d101", + "name": "repos_dbaur_test-repo-visibility-public", + "request": { + "url": "/repos/dbaur/test-repo-visibility-public", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 08:17:21 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "delete_repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4952", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "48", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "Vary": "Accept-Encoding, Accept, X-Requested-With", + "X-GitHub-Request-Id": "C107:B69B:5C90851:5D7B6C5:64D49D11" + } + }, + "uuid": "7941094b-097c-4538-aa6c-f009d286d101", + "persistent": true, + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user-1.json new file mode 100644 index 0000000000..9a0a622540 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user-1.json @@ -0,0 +1,51 @@ +{ + "id": "5371b0ef-81ed-47b9-abf1-7d86a9102827", + "name": "user", + "request": { + "url": "/user", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "user-1.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 08:17:17 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "W/\"548cf23283fa0524609b0128ffe4d2e4d8bfe278a54ae9a93c7bbdcf6b9e199b\"", + "Last-Modified": "Fri, 28 Jul 2023 11:30:28 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4959", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "41", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "118B:73C9:BBA374A:BD604E8:64D49D0C" + } + }, + "uuid": "5371b0ef-81ed-47b9-abf1-7d86a9102827", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user_repos-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user_repos-2.json new file mode 100644 index 0000000000..8e9e2301c6 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user_repos-2.json @@ -0,0 +1,58 @@ +{ + "id": "a4cf11ac-2f3e-434a-a51b-d448a241f4cc", + "name": "user_repos", + "request": { + "url": "/user/repos", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.nebula-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"private\":true,\"visibility\":\"private\",\"name\":\"test-repo-visibility-private\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "user_repos-2.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 08:17:18 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"4b4328107fe0eac23f94e4c77aad112750d131c0fcd3a7b2f709e2db399eb79f\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "public_repo, repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; param=nebula-preview; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4957", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "43", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "84E9:0F26:BF1EA4C:C0DB942:64D49D0D", + "Location": "https://api.github.com/repos/dbaur/test-repo-visibility-private" + } + }, + "uuid": "a4cf11ac-2f3e-434a-a51b-d448a241f4cc", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user_repos-5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user_repos-5.json new file mode 100644 index 0000000000..e2e72551c9 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForUser/mappings/user_repos-5.json @@ -0,0 +1,58 @@ +{ + "id": "0a0e551b-947b-4ff1-ad4e-c345bd3abaae", + "name": "user_repos", + "request": { + "url": "/user/repos", + "method": "POST", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.nebula-preview+json" + } + }, + "bodyPatterns": [ + { + "equalToJson": "{\"private\":false,\"visibility\":\"public\",\"name\":\"test-repo-visibility-public\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "user_repos-5.json", + "headers": { + "Server": "GitHub.com", + "Date": "Thu, 10 Aug 2023 08:17:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding, Accept, X-Requested-With" + ], + "ETag": "\"5d5e2558a98e94e2a9f97bc63f41919c0f5e16a420032274b421560393dce525\"", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages", + "X-Accepted-OAuth-Scopes": "public_repo, repo", + "github-authentication-token-expiration": "2023-09-09 06:40:49 UTC", + "X-GitHub-Media-Type": "github.v3; param=nebula-preview; format=json", + "x-github-api-version-selected": "2022-11-28", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4954", + "X-RateLimit-Reset": "1691657047", + "X-RateLimit-Used": "46", + "X-RateLimit-Resource": "core", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "0", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "31CC:A754:9086FD:920FFE:64D49D0F", + "Location": "https://api.github.com/repos/dbaur/test-repo-visibility-public" + } + }, + "uuid": "0a0e551b-947b-4ff1-ad4e-c345bd3abaae", + "persistent": true, + "insertionIndex": 5 +} \ No newline at end of file