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()); } /** diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index d9bd5165d7..d0ff0f73e1 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; @@ -310,6 +311,57 @@ public void testSetPublic() throws Exception { } } + /** + * Tests the creation of repositories with alternating visibilities for orgs. + * + * @throws Exception + * the exception + */ + @Test + 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 + 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)); + assertThat(organization.getRepository(repoName).getVisibility(), is(visibility)); + } finally { + repository.delete(); + } + } + } + + /** + * 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/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__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/testCreateVisibilityForOrganization/__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/testCreateVisibilityForOrganization/__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 new file mode 100644 index 0000000000..41aefbcfbe --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org_repos-3.json @@ -0,0 +1,140 @@ +{ + "id": 676879845, + "node_id": "R_kgDOKFhd5Q", + "name": "test-repo-visibility-public", + "full_name": "hub4j-test-org/test-repo-visibility-public", + "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-public", + "description": null, + "fork": false, + "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-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", + "svn_url": "https://github.com/hub4j-test-org/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", + "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/testCreateVisibilityForOrganization/__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 new file mode 100644 index 0000000000..41e08d8c90 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/orgs_hub4j-test-org_repos-6.json @@ -0,0 +1,140 @@ +{ + "id": 676879862, + "node_id": "R_kgDOKFhd9g", + "name": "test-repo-visibility-private", + "full_name": "hub4j-test-org/test-repo-visibility-private", + "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-private", + "description": null, + "fork": false, + "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-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", + "svn_url": "https://github.com/hub4j-test-org/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": 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/testCreateVisibilityForOrganization/__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 new file mode 100644 index 0000000000..bb8cbae35d --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/repos_hub4j-test-org_test-repo-visibility-private-7.json @@ -0,0 +1,141 @@ +{ + "id": 676879862, + "node_id": "R_kgDOKFhd9g", + "name": "test-repo-visibility-private", + "full_name": "hub4j-test-org/test-repo-visibility-private", + "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-private", + "description": null, + "fork": false, + "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-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", + "svn_url": "https://github.com/hub4j-test-org/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": 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": "ABXKPQCKFTRVIO2CU2TP4TLE2SPB2", + "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": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__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 new file mode 100644 index 0000000000..18bc5c5494 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/repos_hub4j-test-org_test-repo-visibility-public-4.json @@ -0,0 +1,152 @@ +{ + "id": 676879845, + "node_id": "R_kgDOKFhd5Q", + "name": "test-repo-visibility-public", + "full_name": "hub4j-test-org/test-repo-visibility-public", + "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-public", + "description": null, + "fork": false, + "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-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", + "svn_url": "https://github.com/hub4j-test-org/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", + "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": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__files/user-1.json new file mode 100644 index 0000000000..21dc04da7c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/__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/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org-2.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org-2.json new file mode 100644 index 0000000000..8246f6c638 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org-2.json @@ -0,0 +1,51 @@ +{ + "id": "11b5a503-81c8-4c75-86f4-29aece672ca5", + "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 08:16: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": "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": "4966", + "X-RateLimit-Reset": "1691657047", + "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": "*", + "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": "6DDB:0BF2:C43B083:C5F7EA0:64D49CED" + } + }, + "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/testCreateVisibilityForOrganization/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 new file mode 100644 index 0000000000..c7472e4f1c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org_repos-3.json @@ -0,0 +1,58 @@ +{ + "id": "dd68d6f4-8604-4fa1-8b3e-60008b2641d7", + "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-public\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_hub4j-test-org_repos-3.json", + "headers": { + "Server": "GitHub.com", + "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": "\"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": "4965", + "X-RateLimit-Reset": "1691657047", + "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": "*", + "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": "FD12:37FF:A0FD881:A27FB32:64D49CED", + "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-public" + } + }, + "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/testCreateVisibilityForOrganization/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 new file mode 100644 index 0000000000..3150934e45 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/orgs_hub4j-test-org_repos-6.json @@ -0,0 +1,58 @@ +{ + "id": "4b47fb90-5073-413d-88fb-15e372883c5b", + "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-private\"}", + "ignoreArrayOrder": true, + "ignoreExtraElements": false + } + ] + }, + "response": { + "status": 201, + "bodyFileName": "orgs_hub4j-test-org_repos-6.json", + "headers": { + "Server": "GitHub.com", + "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": "\"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": "4962", + "X-RateLimit-Reset": "1691657047", + "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": "*", + "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": "B4B1:3986:C5D9B60:C79698A:64D49CEF", + "Location": "https://api.github.com/repos/hub4j-test-org/test-repo-visibility-private" + } + }, + "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/testCreateVisibilityForOrganization/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 new file mode 100644 index 0000000000..f7270bb819 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-private-7.json @@ -0,0 +1,51 @@ +{ + "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", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-private-7.json", + "headers": { + "Server": "GitHub.com", + "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/\"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": "4961", + "X-RateLimit-Reset": "1691657047", + "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": "*", + "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": "6FC8:0628:C18DB8F:C34AA1D:64D49CF1" + } + }, + "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/testCreateVisibilityForOrganization/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 new file mode 100644 index 0000000000..0cdae38823 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-private-8.json @@ -0,0 +1,43 @@ +{ + "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", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "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": "4960", + "X-RateLimit-Reset": "1691657047", + "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": "*", + "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": "3ECF:107D4:BA2781C:BBE45B6:64D49CF1" + } + }, + "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/testCreateVisibilityForOrganization/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 new file mode 100644 index 0000000000..ce2cd062bc --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-public-4.json @@ -0,0 +1,51 @@ +{ + "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", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_hub4j-test-org_test-repo-visibility-public-4.json", + "headers": { + "Server": "GitHub.com", + "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/\"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": "4964", + "X-RateLimit-Reset": "1691657047", + "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": "*", + "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": "5FFB:392E:BB82EAB:BD3FBC1:64D49CEE" + } + }, + "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/testCreateVisibilityForOrganization/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 new file mode 100644 index 0000000000..84ecb2d295 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/repos_hub4j-test-org_test-repo-visibility-public-5.json @@ -0,0 +1,43 @@ +{ + "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", + "method": "DELETE", + "headers": { + "Accept": { + "equalTo": "application/vnd.github.v3+json" + } + } + }, + "response": { + "status": 204, + "headers": { + "Server": "GitHub.com", + "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": "4963", + "X-RateLimit-Reset": "1691657047", + "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": "*", + "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": "98FD:392E:BB830AB:BD3FDC3:64D49CEF" + } + }, + "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/testCreateVisibilityForOrganization/mappings/user-1.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/user-1.json new file mode 100644 index 0000000000..adecd246e5 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testCreateVisibilityForOrganization/mappings/user-1.json @@ -0,0 +1,51 @@ +{ + "id": "615f57b7-baf3-473d-ab53-7b9c378c826f", + "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:16:44 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": "4968", + "X-RateLimit-Reset": "1691657047", + "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": "*", + "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": "5300:6CA9:4DBF50F:4E76E9C:64D49CEC" + } + }, + "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