From c85d6107ec7eec50352301ef9f870dec86c7d171 Mon Sep 17 00:00:00 2001 From: Martin van Zijl Date: Thu, 7 Nov 2019 13:41:14 +1300 Subject: [PATCH 1/2] Added method to set repository topics. Fixes #546. --- .../java/org/kohsuke/github/GHRepository.java | 11 +- .../org/kohsuke/github/GHRepositoryTest.java | 22 +- ...-f1d03341-4c95-4c7f-9011-72db07f603a6.json | 41 +++ ...-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json | 330 ++++++++++++++++++ .../orgs_github-api-test-org-1-f1d033.json | 41 +++ ...thub-api-test-org_github-api-2-cca2d5.json | 41 +++ ...i-test-org_github-api_topics-3-cbb440.json | 47 +++ ...i-test-org_github-api_topics-4-44c674.json | 43 +++ ...i-test-org_github-api_topics-5-e31752.json | 42 +++ ...-4331a09d-eb66-4384-a3cb-2079daa42258.json | 41 +++ ...-b4e70cca-45b0-408c-a1a6-3ade8b992016.json | 330 ++++++++++++++++++ .../orgs_github-api-test-org-1-4331a0.json | 41 +++ ...thub-api-test-org_github-api-2-b4e70c.json | 41 +++ ...i-test-org_github-api_topics-3-310b2e.json | 47 +++ ...i-test-org_github-api_topics-4-b51ef5.json | 40 +++ 15 files changed, 1149 insertions(+), 9 deletions(-) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/orgs_github-api-test-org-f1d03341-4c95-4c7f-9011-72db07f603a6.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-1-f1d033.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-2-cca2d5.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-3-cbb440.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-44c674.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-e31752.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/orgs_github-api-test-org-1-4331a0.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api-2-b4e70c.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-3-310b2e.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-4-b51ef5.json diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 7a554c8558..88a13b3be5 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -1763,10 +1763,9 @@ public List listTopics() throws IOException { * Set the topics for this repository. * See https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository */ - // This currently returns a "404" error (as of 30 Oct 2019). -// public void setTopics(List topics) throws IOException { -// Requester requester = new Requester(root); -// requester.with("names", topics); -// requester.method("PUT").withPreview(MERCY).to(getApiTailUrl("topics")); -// } + public void setTopics(List topics) throws IOException { + Requester requester = new Requester(root); + requester.with("names", topics); + requester.method("PUT").withPreview(MERCY).to(getApiTailUrl("topics")); + } } diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index cb6b52dacc..43551bf789 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -5,6 +5,7 @@ import java.io.FileNotFoundException; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import static org.hamcrest.Matchers.is; @@ -270,8 +271,23 @@ public void setMergeOptions() throws IOException { } @Test - public void testListTopics() throws Exception { - List topics = getRepository(gitHub).listTopics(); - assertTrue(topics.contains("api-test-dummy")); + public void testSetTopics() throws Exception { + GHRepository repo = getRepository(gitHub); + + List topics = new ArrayList<>(); + topics.add("api-test-dummy"); + topics.add("java"); + repo.setTopics(topics); + assertTrue(repo.listTopics().contains("api-test-dummy")); + assertTrue(repo.listTopics().contains("java")); + } + + @Test + public void testSetTopicsEmpty() throws Exception { + GHRepository repo = getRepository(gitHub); + + List topics = new ArrayList<>(); + repo.setTopics(topics); + assertTrue(repo.listTopics().isEmpty()); } } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/orgs_github-api-test-org-f1d03341-4c95-4c7f-9011-72db07f603a6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/orgs_github-api-test-org-f1d03341-4c95-4c7f-9011-72db07f603a6.json new file mode 100644 index 0000000000..99b5920ccb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/orgs_github-api-test-org-f1d03341-4c95-4c7f-9011-72db07f603a6.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 10, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 7, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json new file mode 100644 index 0000000000..a905e5ff03 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json @@ -0,0 +1,330 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "github-api-test-org/github-api", + "private": false, + "owner": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api-test-org/github-api", + "description": "Tricky", + "fork": true, + "url": "https://api.github.com/repos/github-api-test-org/github-api", + "forks_url": "https://api.github.com/repos/github-api-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2019-11-07T00:29:49Z", + "pushed_at": "2019-10-21T22:34:49Z", + "git_url": "git://github.com/github-api-test-org/github-api.git", + "ssh_url": "git@github.com:github-api-test-org/github-api.git", + "clone_url": "https://github.com/github-api-test-org/github-api.git", + "svn_url": "https://github.com/github-api-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11391, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-11-06T12:09:45Z", + "pushed_at": "2019-11-06T07:12:42Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 15301, + "stargazers_count": 575, + "watchers_count": 575, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 437, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 57, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 437, + "open_issues": 57, + "watchers": 575, + "default_branch": "master" + }, + "source": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-11-06T12:09:45Z", + "pushed_at": "2019-11-06T07:12:42Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 15301, + "stargazers_count": 575, + "watchers_count": 575, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 437, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 57, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 437, + "open_issues": 57, + "watchers": 575, + "default_branch": "master" + }, + "network_count": 437, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-1-f1d033.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-1-f1d033.json new file mode 100644 index 0000000000..e088ab6375 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-1-f1d033.json @@ -0,0 +1,41 @@ +{ + "id": "f1d03341-4c95-4c7f-9011-72db07f603a6", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-f1d03341-4c95-4c7f-9011-72db07f603a6.json", + "headers": { + "Date": "Thu, 07 Nov 2019 00:29:51 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4890", + "X-RateLimit-Reset": "1573089404", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"4342e0e7004c1a50986c767513fe857d\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "9411:6B14:1318B73:15EE775:5DC3657E" + } + }, + "uuid": "f1d03341-4c95-4c7f-9011-72db07f603a6", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-2-cca2d5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-2-cca2d5.json new file mode 100644 index 0000000000..c38e2e5c55 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-2-cca2d5.json @@ -0,0 +1,41 @@ +{ + "id": "cca2d5e6-1c23-4543-b891-51d1d2ab79c8", + "name": "repos_github-api-test-org_github-api", + "request": { + "url": "/repos/github-api-test-org/github-api", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json", + "headers": { + "Date": "Thu, 07 Nov 2019 00:29:51 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4889", + "X-RateLimit-Reset": "1573089404", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"0e3165be3aeee4e763ac9861f3fb4f98\"", + "Last-Modified": "Thu, 07 Nov 2019 00:29:49 GMT", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "9411:6B14:1318B89:15EE790:5DC3657F" + } + }, + "uuid": "cca2d5e6-1c23-4543-b891-51d1d2ab79c8", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-3-cbb440.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-3-cbb440.json new file mode 100644 index 0000000000..cc3adfafd3 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-3-cbb440.json @@ -0,0 +1,47 @@ +{ + "id": "cbb4409f-3327-4cb3-bdbb-70d4e9aa2802", + "name": "repos_github-api-test-org_github-api_topics", + "request": { + "url": "/repos/github-api-test-org/github-api/topics", + "method": "PUT", + "bodyPatterns": [ + { + "equalToJson": "{\"names\":[\"api-test-dummy\",\"java\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"names\":[\"api-test-dummy\",\"java\"]}", + "headers": { + "Date": "Thu, 07 Nov 2019 00:29:52 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4888", + "X-RateLimit-Reset": "1573089404", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"bb8a902204adac24713280143d4f2542\"", + "X-GitHub-Media-Type": "github.mercy-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "9411:6B14:1318BA3:15EE7AE:5DC3657F" + } + }, + "uuid": "cbb4409f-3327-4cb3-bdbb-70d4e9aa2802", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-44c674.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-44c674.json new file mode 100644 index 0000000000..46de70598f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-44c674.json @@ -0,0 +1,43 @@ +{ + "id": "44c674a1-d6bf-448f-b5a2-4ff860e3921d", + "name": "repos_github-api-test-org_github-api_topics", + "request": { + "url": "/repos/github-api-test-org/github-api/topics", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"names\":[\"api-test-dummy\",\"java\"]}", + "headers": { + "Date": "Thu, 07 Nov 2019 00:29:52 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4887", + "X-RateLimit-Reset": "1573089404", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"bb8a902204adac24713280143d4f2542\"", + "X-GitHub-Media-Type": "github.mercy-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "9411:6B14:1318BCB:15EE7D8:5DC36580" + } + }, + "uuid": "44c674a1-d6bf-448f-b5a2-4ff860e3921d", + "persistent": true, + "scenarioName": "scenario-1-repos-github-api-test-org-github-api-topics", + "requiredScenarioState": "Started", + "newScenarioState": "scenario-1-repos-github-api-test-org-github-api-topics-2", + "insertionIndex": 4 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-e31752.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-e31752.json new file mode 100644 index 0000000000..c333399745 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-e31752.json @@ -0,0 +1,42 @@ +{ + "id": "e31752bc-0a6b-4840-aa15-bf2958cbc4d2", + "name": "repos_github-api-test-org_github-api_topics", + "request": { + "url": "/repos/github-api-test-org/github-api/topics", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"names\":[\"api-test-dummy\",\"java\"]}", + "headers": { + "Date": "Thu, 07 Nov 2019 00:29:53 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4886", + "X-RateLimit-Reset": "1573089404", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"bb8a902204adac24713280143d4f2542\"", + "X-GitHub-Media-Type": "github.mercy-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "9411:6B14:1318BDD:15EE7EE:5DC36580" + } + }, + "uuid": "e31752bc-0a6b-4840-aa15-bf2958cbc4d2", + "persistent": true, + "scenarioName": "scenario-1-repos-github-api-test-org-github-api-topics", + "requiredScenarioState": "scenario-1-repos-github-api-test-org-github-api-topics-2", + "insertionIndex": 5 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json new file mode 100644 index 0000000000..99b5920ccb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json @@ -0,0 +1,41 @@ +{ + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "url": "https://api.github.com/orgs/github-api-test-org", + "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", + "events_url": "https://api.github.com/orgs/github-api-test-org/events", + "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", + "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", + "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", + "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "description": null, + "is_verified": false, + "has_organization_projects": true, + "has_repository_projects": true, + "public_repos": 10, + "public_gists": 0, + "followers": 0, + "following": 0, + "html_url": "https://github.com/github-api-test-org", + "created_at": "2014-05-10T19:39:11Z", + "updated_at": "2015-04-20T00:42:30Z", + "type": "Organization", + "total_private_repos": 0, + "owned_private_repos": 0, + "private_gists": 0, + "disk_usage": 132, + "collaborators": 0, + "billing_email": "kk@kohsuke.org", + "default_repository_permission": "none", + "members_can_create_repositories": false, + "two_factor_requirement_enabled": false, + "plan": { + "name": "free", + "space": 976562499, + "private_repos": 0, + "filled_seats": 7, + "seats": 0 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json new file mode 100644 index 0000000000..75cc867d6f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json @@ -0,0 +1,330 @@ +{ + "id": 206888201, + "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", + "name": "github-api", + "full_name": "github-api-test-org/github-api", + "private": false, + "owner": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api-test-org/github-api", + "description": "Tricky", + "fork": true, + "url": "https://api.github.com/repos/github-api-test-org/github-api", + "forks_url": "https://api.github.com/repos/github-api-test-org/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments", + "created_at": "2019-09-06T23:26:04Z", + "updated_at": "2019-11-07T00:25:40Z", + "pushed_at": "2019-10-21T22:34:49Z", + "git_url": "git://github.com/github-api-test-org/github-api.git", + "ssh_url": "git@github.com:github-api-test-org/github-api.git", + "clone_url": "https://github.com/github-api-test-org/github-api.git", + "svn_url": "https://github.com/github-api-test-org/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 11391, + "stargazers_count": 0, + "watchers_count": 0, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "organization": { + "login": "github-api-test-org", + "id": 7544739, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", + "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api-test-org", + "html_url": "https://github.com/github-api-test-org", + "followers_url": "https://api.github.com/users/github-api-test-org/followers", + "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", + "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", + "repos_url": "https://api.github.com/users/github-api-test-org/repos", + "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", + "type": "Organization", + "site_admin": false + }, + "parent": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-11-06T12:09:45Z", + "pushed_at": "2019-11-06T07:12:42Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 15301, + "stargazers_count": 575, + "watchers_count": 575, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 437, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 57, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 437, + "open_issues": 57, + "watchers": 575, + "default_branch": "master" + }, + "source": { + "id": 617210, + "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", + "name": "github-api", + "full_name": "github-api/github-api", + "private": false, + "owner": { + "login": "github-api", + "id": 54909825, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", + "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-api", + "html_url": "https://github.com/github-api", + "followers_url": "https://api.github.com/users/github-api/followers", + "following_url": "https://api.github.com/users/github-api/following{/other_user}", + "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", + "organizations_url": "https://api.github.com/users/github-api/orgs", + "repos_url": "https://api.github.com/users/github-api/repos", + "events_url": "https://api.github.com/users/github-api/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-api/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/github-api/github-api", + "description": "Java API for GitHub", + "fork": false, + "url": "https://api.github.com/repos/github-api/github-api", + "forks_url": "https://api.github.com/repos/github-api/github-api/forks", + "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api/github-api/teams", + "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", + "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api/github-api/events", + "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api/github-api/tags", + "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api/github-api/languages", + "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", + "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", + "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", + "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", + "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api/github-api/merges", + "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", + "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", + "created_at": "2010-04-19T04:13:03Z", + "updated_at": "2019-11-06T12:09:45Z", + "pushed_at": "2019-11-06T07:12:42Z", + "git_url": "git://github.com/github-api/github-api.git", + "ssh_url": "git@github.com:github-api/github-api.git", + "clone_url": "https://github.com/github-api/github-api.git", + "svn_url": "https://github.com/github-api/github-api", + "homepage": "http://github-api.kohsuke.org/", + "size": 15301, + "stargazers_count": 575, + "watchers_count": 575, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 437, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 57, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 437, + "open_issues": 57, + "watchers": 575, + "default_branch": "master" + }, + "network_count": 437, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/orgs_github-api-test-org-1-4331a0.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/orgs_github-api-test-org-1-4331a0.json new file mode 100644 index 0000000000..c99aca3c39 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/orgs_github-api-test-org-1-4331a0.json @@ -0,0 +1,41 @@ +{ + "id": "4331a09d-eb66-4384-a3cb-2079daa42258", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json", + "headers": { + "Date": "Thu, 07 Nov 2019 00:29:48 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4894", + "X-RateLimit-Reset": "1573089404", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"4342e0e7004c1a50986c767513fe857d\"", + "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "940A:4537:12DFD32:15B9872:5DC3657C" + } + }, + "uuid": "4331a09d-eb66-4384-a3cb-2079daa42258", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api-2-b4e70c.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api-2-b4e70c.json new file mode 100644 index 0000000000..f5c5db5d61 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api-2-b4e70c.json @@ -0,0 +1,41 @@ +{ + "id": "b4e70cca-45b0-408c-a1a6-3ade8b992016", + "name": "repos_github-api-test-org_github-api", + "request": { + "url": "/repos/github-api-test-org/github-api", + "method": "GET" + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json", + "headers": { + "Date": "Thu, 07 Nov 2019 00:29:49 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4893", + "X-RateLimit-Reset": "1573089404", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"3bc6d84ee238bda95a4728ca523fda9f\"", + "Last-Modified": "Thu, 07 Nov 2019 00:25:40 GMT", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "940A:4537:12DFD3F:15B987F:5DC3657C" + } + }, + "uuid": "b4e70cca-45b0-408c-a1a6-3ade8b992016", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-3-310b2e.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-3-310b2e.json new file mode 100644 index 0000000000..8f54cb535a --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-3-310b2e.json @@ -0,0 +1,47 @@ +{ + "id": "310b2ed0-6d05-4f42-8474-9780fe5e6a22", + "name": "repos_github-api-test-org_github-api_topics", + "request": { + "url": "/repos/github-api-test-org/github-api/topics", + "method": "PUT", + "bodyPatterns": [ + { + "equalToJson": "{\"names\":[]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"names\":[]}", + "headers": { + "Date": "Thu, 07 Nov 2019 00:29:49 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4892", + "X-RateLimit-Reset": "1573089404", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"5a6bf327a32faef715353aa30363d698\"", + "X-GitHub-Media-Type": "github.mercy-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "940A:4537:12DFD4F:15B9896:5DC3657D" + } + }, + "uuid": "310b2ed0-6d05-4f42-8474-9780fe5e6a22", + "persistent": true, + "insertionIndex": 3 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-4-b51ef5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-4-b51ef5.json new file mode 100644 index 0000000000..df7cb922ff --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-4-b51ef5.json @@ -0,0 +1,40 @@ +{ + "id": "b51ef51d-8703-4e6f-abf4-45bbacc5b8cb", + "name": "repos_github-api-test-org_github-api_topics", + "request": { + "url": "/repos/github-api-test-org/github-api/topics", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"names\":[]}", + "headers": { + "Date": "Thu, 07 Nov 2019 00:29:50 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4891", + "X-RateLimit-Reset": "1573089404", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "\"5a6bf327a32faef715353aa30363d698\"", + "X-GitHub-Media-Type": "github.mercy-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "940A:4537:12DFD63:15B98B1:5DC3657D" + } + }, + "uuid": "b51ef51d-8703-4e6f-abf4-45bbacc5b8cb", + "persistent": true, + "insertionIndex": 4 +} \ No newline at end of file From f9cf2878efcf14543417e67a1c84f18efdfe2cae Mon Sep 17 00:00:00 2001 From: Liam Newman Date: Wed, 6 Nov 2019 21:20:55 -0800 Subject: [PATCH 2/2] Tweaks to test --- .../org/kohsuke/github/GHRepositoryTest.java | 29 +- ...0774979f-2840-46c6-ac31-ea9ebea16a15.json} | 0 ...6396d3b5-36ad-4990-a691-55a3bca11280.json} | 14 +- ...-489e213c-810a-407d-b9aa-f7b00cdc8995.json | 45 +++ .../orgs_github-api-test-org-2-077497.json} | 20 +- ...hub-api-test-org_github-api-3-6396d3.json} | 22 +- ...test-org_github-api_topics-10-d74974.json} | 18 +- ...test-org_github-api_topics-11-57a970.json} | 22 +- ...-test-org_github-api_topics-4-e6442e.json} | 22 +- ...-test-org_github-api_topics-5-2dc36e.json} | 20 +- ...i-test-org_github-api_topics-6-83a58f.json | 49 +++ ...i-test-org_github-api_topics-7-eed846.json | 45 +++ ...i-test-org_github-api_topics-8-df3c07.json | 49 +++ ...-test-org_github-api_topics-9-6159ab.json} | 23 +- ...t-org-1-f1d033.json => user-1-489e21.json} | 24 +- ...-4331a09d-eb66-4384-a3cb-2079daa42258.json | 41 --- ...-b4e70cca-45b0-408c-a1a6-3ade8b992016.json | 330 ------------------ ...thub-api-test-org_github-api-2-b4e70c.json | 41 --- 18 files changed, 311 insertions(+), 503 deletions(-) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/{orgs_github-api-test-org-f1d03341-4c95-4c7f-9011-72db07f603a6.json => orgs_github-api-test-org-0774979f-2840-46c6-ac31-ea9ebea16a15.json} (100%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/{repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json => repos_github-api-test-org_github-api-6396d3b5-36ad-4990-a691-55a3bca11280.json} (98%) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/user-489e213c-810a-407d-b9aa-f7b00cdc8995.json rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetTopicsEmpty/mappings/orgs_github-api-test-org-1-4331a0.json => testSetTopics/mappings/orgs_github-api-test-org-2-077497.json} (64%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/{repos_github-api-test-org_github-api-2-cca2d5.json => repos_github-api-test-org_github-api-3-6396d3.json} (62%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-3-310b2e.json => testSetTopics/mappings/repos_github-api-test-org_github-api_topics-10-d74974.json} (71%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/{repos_github-api-test-org_github-api_topics-5-e31752.json => repos_github-api-test-org_github-api_topics-11-57a970.json} (69%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/{repos_github-api-test-org_github-api_topics-3-cbb440.json => repos_github-api-test-org_github-api_topics-4-e6442e.json} (66%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/{repos_github-api-test-org_github-api_topics-4-44c674.json => repos_github-api-test-org_github-api_topics-5-2dc36e.json} (69%) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-6-83a58f.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-7-eed846.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-8-df3c07.json rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-4-b51ef5.json => testSetTopics/mappings/repos_github-api-test-org_github-api_topics-9-6159ab.json} (58%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/{orgs_github-api-test-org-1-f1d033.json => user-1-489e21.json} (61%) delete mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json delete mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json delete mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api-2-b4e70c.json diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 43551bf789..f19955be9e 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -8,6 +8,7 @@ import java.util.ArrayList; import java.util.List; +import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.is; import static org.junit.Assert.*; import static org.junit.Assume.assumeFalse; @@ -275,19 +276,31 @@ public void testSetTopics() throws Exception { GHRepository repo = getRepository(gitHub); List topics = new ArrayList<>(); + + topics.add("java"); + topics.add("api-test-dummy"); + repo.setTopics(topics); + assertThat("Topics retain input order (are not sort when stored)", + repo.listTopics(), contains("java", "api-test-dummy")); + + topics = new ArrayList<>(); + topics.add("ordered-state"); topics.add("api-test-dummy"); topics.add("java"); repo.setTopics(topics); - assertTrue(repo.listTopics().contains("api-test-dummy")); - assertTrue(repo.listTopics().contains("java")); - } + assertThat("Topics behave as a set and retain order from previous calls", + repo.listTopics(), contains("java", "api-test-dummy", "ordered-state")); - @Test - public void testSetTopicsEmpty() throws Exception { - GHRepository repo = getRepository(gitHub); + topics = new ArrayList<>(); + topics.add("ordered-state"); + topics.add("api-test-dummy"); + repo.setTopics(topics); + assertThat("Topics retain order even when some are removed", + repo.listTopics(), contains("api-test-dummy", "ordered-state")); - List topics = new ArrayList<>(); + topics = new ArrayList<>(); repo.setTopics(topics); - assertTrue(repo.listTopics().isEmpty()); + assertTrue("Topics can be set to empty", + repo.listTopics().isEmpty()); } } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/orgs_github-api-test-org-f1d03341-4c95-4c7f-9011-72db07f603a6.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/orgs_github-api-test-org-0774979f-2840-46c6-ac31-ea9ebea16a15.json similarity index 100% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/orgs_github-api-test-org-f1d03341-4c95-4c7f-9011-72db07f603a6.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/orgs_github-api-test-org-0774979f-2840-46c6-ac31-ea9ebea16a15.json diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-6396d3b5-36ad-4990-a691-55a3bca11280.json similarity index 98% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-6396d3b5-36ad-4990-a691-55a3bca11280.json index a905e5ff03..ce49021e8b 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/repos_github-api-test-org_github-api-6396d3b5-36ad-4990-a691-55a3bca11280.json @@ -65,7 +65,7 @@ "releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}", "deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments", "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-11-07T00:29:49Z", + "updated_at": "2019-11-07T05:19:07Z", "pushed_at": "2019-10-21T22:34:49Z", "git_url": "git://github.com/github-api-test-org/github-api.git", "ssh_url": "git@github.com:github-api-test-org/github-api.git", @@ -193,7 +193,7 @@ "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", "created_at": "2010-04-19T04:13:03Z", "updated_at": "2019-11-06T12:09:45Z", - "pushed_at": "2019-11-06T07:12:42Z", + "pushed_at": "2019-11-07T04:38:19Z", "git_url": "git://github.com/github-api/github-api.git", "ssh_url": "git@github.com:github-api/github-api.git", "clone_url": "https://github.com/github-api/github-api.git", @@ -212,7 +212,7 @@ "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 57, + "open_issues_count": 60, "license": { "key": "mit", "name": "MIT License", @@ -221,7 +221,7 @@ "node_id": "MDc6TGljZW5zZTEz" }, "forks": 437, - "open_issues": 57, + "open_issues": 60, "watchers": 575, "default_branch": "master" }, @@ -293,7 +293,7 @@ "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", "created_at": "2010-04-19T04:13:03Z", "updated_at": "2019-11-06T12:09:45Z", - "pushed_at": "2019-11-06T07:12:42Z", + "pushed_at": "2019-11-07T04:38:19Z", "git_url": "git://github.com/github-api/github-api.git", "ssh_url": "git@github.com:github-api/github-api.git", "clone_url": "https://github.com/github-api/github-api.git", @@ -312,7 +312,7 @@ "mirror_url": null, "archived": false, "disabled": false, - "open_issues_count": 57, + "open_issues_count": 60, "license": { "key": "mit", "name": "MIT License", @@ -321,7 +321,7 @@ "node_id": "MDc6TGljZW5zZTEz" }, "forks": 437, - "open_issues": 57, + "open_issues": 60, "watchers": 575, "default_branch": "master" }, diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/user-489e213c-810a-407d-b9aa-f7b00cdc8995.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/user-489e213c-810a-407d-b9aa-f7b00cdc8995.json new file mode 100644 index 0000000000..c70bfef17b --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/__files/user-489e213c-810a-407d-b9aa-f7b00cdc8995.json @@ -0,0 +1,45 @@ +{ + "login": "bitwiseman", + "id": 1958953, + "node_id": "MDQ6VXNlcjE5NTg5NTM=", + "avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/bitwiseman", + "html_url": "https://github.com/bitwiseman", + "followers_url": "https://api.github.com/users/bitwiseman/followers", + "following_url": "https://api.github.com/users/bitwiseman/following{/other_user}", + "gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}", + "starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions", + "organizations_url": "https://api.github.com/users/bitwiseman/orgs", + "repos_url": "https://api.github.com/users/bitwiseman/repos", + "events_url": "https://api.github.com/users/bitwiseman/events{/privacy}", + "received_events_url": "https://api.github.com/users/bitwiseman/received_events", + "type": "User", + "site_admin": false, + "name": "Liam Newman", + "company": "Cloudbees, Inc.", + "blog": "", + "location": "Seattle, WA, USA", + "email": "bitwiseman@gmail.com", + "hireable": null, + "bio": "https://twitter.com/bitwiseman", + "public_repos": 174, + "public_gists": 7, + "followers": 139, + "following": 9, + "created_at": "2012-07-11T20:38:33Z", + "updated_at": "2019-09-24T19:32:29Z", + "private_gists": 7, + "total_private_repos": 9, + "owned_private_repos": 0, + "disk_usage": 33697, + "collaborators": 0, + "two_factor_authentication": true, + "plan": { + "name": "free", + "space": 976562499, + "collaborators": 0, + "private_repos": 10000 + } +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/orgs_github-api-test-org-1-4331a0.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-2-077497.json similarity index 64% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/orgs_github-api-test-org-1-4331a0.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-2-077497.json index c99aca3c39..167ffc6d40 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/orgs_github-api-test-org-1-4331a0.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-2-077497.json @@ -1,5 +1,5 @@ { - "id": "4331a09d-eb66-4384-a3cb-2079daa42258", + "id": "0774979f-2840-46c6-ac31-ea9ebea16a15", "name": "orgs_github-api-test-org", "request": { "url": "/orgs/github-api-test-org", @@ -7,22 +7,24 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json", + "bodyFileName": "orgs_github-api-test-org-0774979f-2840-46c6-ac31-ea9ebea16a15.json", "headers": { - "Date": "Thu, 07 Nov 2019 00:29:48 GMT", + "Date": "Thu, 07 Nov 2019 05:19:27 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4894", - "X-RateLimit-Reset": "1573089404", + "X-RateLimit-Remaining": "4934", + "X-RateLimit-Reset": "1573107045", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "W/\"4342e0e7004c1a50986c767513fe857d\"", + "ETag": "W/\"bbee0a14a82ca84871298052e1bcb545\"", "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "admin:org, read:org, repo, user, write:org", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -32,10 +34,10 @@ "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "940A:4537:12DFD32:15B9872:5DC3657C" + "X-GitHub-Request-Id": "EE66:9B40:1DDF992:2298B7D:5DC3A95E" } }, - "uuid": "4331a09d-eb66-4384-a3cb-2079daa42258", + "uuid": "0774979f-2840-46c6-ac31-ea9ebea16a15", "persistent": true, - "insertionIndex": 1 + "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-2-cca2d5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-3-6396d3.json similarity index 62% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-2-cca2d5.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-3-6396d3.json index c38e2e5c55..94adf7776d 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-2-cca2d5.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api-3-6396d3.json @@ -1,5 +1,5 @@ { - "id": "cca2d5e6-1c23-4543-b891-51d1d2ab79c8", + "id": "6396d3b5-36ad-4990-a691-55a3bca11280", "name": "repos_github-api-test-org_github-api", "request": { "url": "/repos/github-api-test-org/github-api", @@ -7,22 +7,24 @@ }, "response": { "status": 200, - "bodyFileName": "repos_github-api-test-org_github-api-cca2d5e6-1c23-4543-b891-51d1d2ab79c8.json", + "bodyFileName": "repos_github-api-test-org_github-api-6396d3b5-36ad-4990-a691-55a3bca11280.json", "headers": { - "Date": "Thu, 07 Nov 2019 00:29:51 GMT", + "Date": "Thu, 07 Nov 2019 05:19:27 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4889", - "X-RateLimit-Reset": "1573089404", + "X-RateLimit-Remaining": "4933", + "X-RateLimit-Reset": "1573107045", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "W/\"0e3165be3aeee4e763ac9861f3fb4f98\"", - "Last-Modified": "Thu, 07 Nov 2019 00:29:49 GMT", + "ETag": "W/\"7998c1d58ba95b2e4a1c263537718671\"", + "Last-Modified": "Thu, 07 Nov 2019 05:19:07 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -32,10 +34,10 @@ "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "9411:6B14:1318B89:15EE790:5DC3657F" + "X-GitHub-Request-Id": "EE66:9B40:1DDF99E:2298BA4:5DC3A95F" } }, - "uuid": "cca2d5e6-1c23-4543-b891-51d1d2ab79c8", + "uuid": "6396d3b5-36ad-4990-a691-55a3bca11280", "persistent": true, - "insertionIndex": 2 + "insertionIndex": 3 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-3-310b2e.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-10-d74974.json similarity index 71% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-3-310b2e.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-10-d74974.json index 8f54cb535a..dbaee8f759 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-3-310b2e.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-10-d74974.json @@ -1,5 +1,5 @@ { - "id": "310b2ed0-6d05-4f42-8474-9780fe5e6a22", + "id": "d7497474-d02e-4ff8-bd80-d0309cc549ee", "name": "repos_github-api-test-org_github-api_topics", "request": { "url": "/repos/github-api-test-org/github-api/topics", @@ -16,19 +16,21 @@ "status": 200, "body": "{\"names\":[]}", "headers": { - "Date": "Thu, 07 Nov 2019 00:29:49 GMT", + "Date": "Thu, 07 Nov 2019 05:19:30 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4892", - "X-RateLimit-Reset": "1573089404", + "X-RateLimit-Remaining": "4926", + "X-RateLimit-Reset": "1573107045", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "\"5a6bf327a32faef715353aa30363d698\"", + "ETag": "\"df993ad275c898093787f01e3ed7a555\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "github.mercy-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -38,10 +40,10 @@ "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "940A:4537:12DFD4F:15B9896:5DC3657D" + "X-GitHub-Request-Id": "EE66:9B40:1DDFA26:2298C44:5DC3A961" } }, - "uuid": "310b2ed0-6d05-4f42-8474-9780fe5e6a22", + "uuid": "d7497474-d02e-4ff8-bd80-d0309cc549ee", "persistent": true, - "insertionIndex": 3 + "insertionIndex": 10 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-e31752.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-11-57a970.json similarity index 69% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-e31752.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-11-57a970.json index c333399745..04a783da84 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-e31752.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-11-57a970.json @@ -1,5 +1,5 @@ { - "id": "e31752bc-0a6b-4840-aa15-bf2958cbc4d2", + "id": "57a97040-b886-484e-ae11-9274c28a57fa", "name": "repos_github-api-test-org_github-api_topics", "request": { "url": "/repos/github-api-test-org/github-api/topics", @@ -7,21 +7,23 @@ }, "response": { "status": 200, - "body": "{\"names\":[\"api-test-dummy\",\"java\"]}", + "body": "{\"names\":[]}", "headers": { - "Date": "Thu, 07 Nov 2019 00:29:53 GMT", + "Date": "Thu, 07 Nov 2019 05:19:30 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4886", - "X-RateLimit-Reset": "1573089404", + "X-RateLimit-Remaining": "4925", + "X-RateLimit-Reset": "1573107045", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "W/\"bb8a902204adac24713280143d4f2542\"", + "ETag": "\"df993ad275c898093787f01e3ed7a555\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "github.mercy-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -31,12 +33,12 @@ "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "9411:6B14:1318BDD:15EE7EE:5DC36580" + "X-GitHub-Request-Id": "EE66:9B40:1DDFA4D:2298C66:5DC3A962" } }, - "uuid": "e31752bc-0a6b-4840-aa15-bf2958cbc4d2", + "uuid": "57a97040-b886-484e-ae11-9274c28a57fa", "persistent": true, "scenarioName": "scenario-1-repos-github-api-test-org-github-api-topics", - "requiredScenarioState": "scenario-1-repos-github-api-test-org-github-api-topics-2", - "insertionIndex": 5 + "requiredScenarioState": "scenario-1-repos-github-api-test-org-github-api-topics-4", + "insertionIndex": 11 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-3-cbb440.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-e6442e.json similarity index 66% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-3-cbb440.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-e6442e.json index cc3adfafd3..afd81a019a 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-3-cbb440.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-e6442e.json @@ -1,12 +1,12 @@ { - "id": "cbb4409f-3327-4cb3-bdbb-70d4e9aa2802", + "id": "e6442e95-3680-401a-a9e9-722c7cff3a8c", "name": "repos_github-api-test-org_github-api_topics", "request": { "url": "/repos/github-api-test-org/github-api/topics", "method": "PUT", "bodyPatterns": [ { - "equalToJson": "{\"names\":[\"api-test-dummy\",\"java\"]}", + "equalToJson": "{\"names\":[\"java\",\"api-test-dummy\"]}", "ignoreArrayOrder": true, "ignoreExtraElements": true } @@ -14,21 +14,23 @@ }, "response": { "status": 200, - "body": "{\"names\":[\"api-test-dummy\",\"java\"]}", + "body": "{\"names\":[\"java\",\"api-test-dummy\"]}", "headers": { - "Date": "Thu, 07 Nov 2019 00:29:52 GMT", + "Date": "Thu, 07 Nov 2019 05:19:27 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4888", - "X-RateLimit-Reset": "1573089404", + "X-RateLimit-Remaining": "4932", + "X-RateLimit-Reset": "1573107045", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "W/\"bb8a902204adac24713280143d4f2542\"", + "ETag": "W/\"ea65e8cf500f844d9fc218733c1732b8\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "github.mercy-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -38,10 +40,10 @@ "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "9411:6B14:1318BA3:15EE7AE:5DC3657F" + "X-GitHub-Request-Id": "EE66:9B40:1DDF9AA:2298BB0:5DC3A95F" } }, - "uuid": "cbb4409f-3327-4cb3-bdbb-70d4e9aa2802", + "uuid": "e6442e95-3680-401a-a9e9-722c7cff3a8c", "persistent": true, - "insertionIndex": 3 + "insertionIndex": 4 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-44c674.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-2dc36e.json similarity index 69% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-44c674.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-2dc36e.json index 46de70598f..89f7bc8afe 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-4-44c674.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-5-2dc36e.json @@ -1,5 +1,5 @@ { - "id": "44c674a1-d6bf-448f-b5a2-4ff860e3921d", + "id": "2dc36e0e-a168-491c-a8f5-4c118c78babd", "name": "repos_github-api-test-org_github-api_topics", "request": { "url": "/repos/github-api-test-org/github-api/topics", @@ -7,21 +7,23 @@ }, "response": { "status": 200, - "body": "{\"names\":[\"api-test-dummy\",\"java\"]}", + "body": "{\"names\":[\"java\",\"api-test-dummy\"]}", "headers": { - "Date": "Thu, 07 Nov 2019 00:29:52 GMT", + "Date": "Thu, 07 Nov 2019 05:19:28 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4887", - "X-RateLimit-Reset": "1573089404", + "X-RateLimit-Remaining": "4931", + "X-RateLimit-Reset": "1573107045", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "W/\"bb8a902204adac24713280143d4f2542\"", + "ETag": "W/\"ea65e8cf500f844d9fc218733c1732b8\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "github.mercy-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -31,13 +33,13 @@ "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "9411:6B14:1318BCB:15EE7D8:5DC36580" + "X-GitHub-Request-Id": "EE66:9B40:1DDF9BE:2298BC5:5DC3A95F" } }, - "uuid": "44c674a1-d6bf-448f-b5a2-4ff860e3921d", + "uuid": "2dc36e0e-a168-491c-a8f5-4c118c78babd", "persistent": true, "scenarioName": "scenario-1-repos-github-api-test-org-github-api-topics", "requiredScenarioState": "Started", "newScenarioState": "scenario-1-repos-github-api-test-org-github-api-topics-2", - "insertionIndex": 4 + "insertionIndex": 5 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-6-83a58f.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-6-83a58f.json new file mode 100644 index 0000000000..273d1ecd27 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-6-83a58f.json @@ -0,0 +1,49 @@ +{ + "id": "83a58ffe-c7c7-40f7-9799-0690e352466f", + "name": "repos_github-api-test-org_github-api_topics", + "request": { + "url": "/repos/github-api-test-org/github-api/topics", + "method": "PUT", + "bodyPatterns": [ + { + "equalToJson": "{\"names\":[\"ordered-state\",\"api-test-dummy\",\"java\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"names\":[\"java\",\"api-test-dummy\",\"ordered-state\"]}", + "headers": { + "Date": "Thu, 07 Nov 2019 05:19:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4930", + "X-RateLimit-Reset": "1573107045", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"a917b5929ad915f6d77f47f9626ee739\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "github.mercy-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EE66:9B40:1DDF9CB:2298BD7:5DC3A960" + } + }, + "uuid": "83a58ffe-c7c7-40f7-9799-0690e352466f", + "persistent": true, + "insertionIndex": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-7-eed846.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-7-eed846.json new file mode 100644 index 0000000000..c5457405c0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-7-eed846.json @@ -0,0 +1,45 @@ +{ + "id": "eed8467b-8135-4bb0-aa71-e4c7f6c38edc", + "name": "repos_github-api-test-org_github-api_topics", + "request": { + "url": "/repos/github-api-test-org/github-api/topics", + "method": "GET" + }, + "response": { + "status": 200, + "body": "{\"names\":[\"java\",\"api-test-dummy\",\"ordered-state\"]}", + "headers": { + "Date": "Thu, 07 Nov 2019 05:19:28 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4929", + "X-RateLimit-Reset": "1573107045", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"a917b5929ad915f6d77f47f9626ee739\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "github.mercy-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EE66:9B40:1DDF9E1:2298BF2:5DC3A960" + } + }, + "uuid": "eed8467b-8135-4bb0-aa71-e4c7f6c38edc", + "persistent": true, + "scenarioName": "scenario-1-repos-github-api-test-org-github-api-topics", + "requiredScenarioState": "scenario-1-repos-github-api-test-org-github-api-topics-2", + "newScenarioState": "scenario-1-repos-github-api-test-org-github-api-topics-3", + "insertionIndex": 7 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-8-df3c07.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-8-df3c07.json new file mode 100644 index 0000000000..3277b2e4eb --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-8-df3c07.json @@ -0,0 +1,49 @@ +{ + "id": "df3c075d-0311-4a33-bbc5-bb9146c0eb8c", + "name": "repos_github-api-test-org_github-api_topics", + "request": { + "url": "/repos/github-api-test-org/github-api/topics", + "method": "PUT", + "bodyPatterns": [ + { + "equalToJson": "{\"names\":[\"ordered-state\",\"api-test-dummy\"]}", + "ignoreArrayOrder": true, + "ignoreExtraElements": true + } + ] + }, + "response": { + "status": 200, + "body": "{\"names\":[\"api-test-dummy\",\"ordered-state\"]}", + "headers": { + "Date": "Thu, 07 Nov 2019 05:19:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Server": "GitHub.com", + "Status": "200 OK", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4928", + "X-RateLimit-Reset": "1573107045", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding" + ], + "ETag": "W/\"7cf11892f99547fa0b0870388bfd00f7\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "github.mercy-preview; format=json", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "EE66:9B40:1DDF9F0:2298C05:5DC3A960" + } + }, + "uuid": "df3c075d-0311-4a33-bbc5-bb9146c0eb8c", + "persistent": true, + "insertionIndex": 8 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-4-b51ef5.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-9-6159ab.json similarity index 58% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-4-b51ef5.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-9-6159ab.json index df7cb922ff..0347bc5a3c 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api_topics-4-b51ef5.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/repos_github-api-test-org_github-api_topics-9-6159ab.json @@ -1,5 +1,5 @@ { - "id": "b51ef51d-8703-4e6f-abf4-45bbacc5b8cb", + "id": "6159ab53-1522-4d89-933a-734578f4481a", "name": "repos_github-api-test-org_github-api_topics", "request": { "url": "/repos/github-api-test-org/github-api/topics", @@ -7,21 +7,23 @@ }, "response": { "status": 200, - "body": "{\"names\":[]}", + "body": "{\"names\":[\"api-test-dummy\",\"ordered-state\"]}", "headers": { - "Date": "Thu, 07 Nov 2019 00:29:50 GMT", + "Date": "Thu, 07 Nov 2019 05:19:29 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4891", - "X-RateLimit-Reset": "1573089404", + "X-RateLimit-Remaining": "4927", + "X-RateLimit-Reset": "1573107045", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "\"5a6bf327a32faef715353aa30363d698\"", + "ETag": "W/\"7cf11892f99547fa0b0870388bfd00f7\"", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "github.mercy-preview; format=json", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -31,10 +33,13 @@ "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "940A:4537:12DFD63:15B98B1:5DC3657D" + "X-GitHub-Request-Id": "EE66:9B40:1DDFA1A:2298C33:5DC3A961" } }, - "uuid": "b51ef51d-8703-4e6f-abf4-45bbacc5b8cb", + "uuid": "6159ab53-1522-4d89-933a-734578f4481a", "persistent": true, - "insertionIndex": 4 + "scenarioName": "scenario-1-repos-github-api-test-org-github-api-topics", + "requiredScenarioState": "scenario-1-repos-github-api-test-org-github-api-topics-3", + "newScenarioState": "scenario-1-repos-github-api-test-org-github-api-topics-4", + "insertionIndex": 9 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-1-f1d033.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/user-1-489e21.json similarity index 61% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-1-f1d033.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/user-1-489e21.json index e088ab6375..9caeb5b937 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/orgs_github-api-test-org-1-f1d033.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopics/mappings/user-1-489e21.json @@ -1,28 +1,30 @@ { - "id": "f1d03341-4c95-4c7f-9011-72db07f603a6", - "name": "orgs_github-api-test-org", + "id": "489e213c-810a-407d-b9aa-f7b00cdc8995", + "name": "user", "request": { - "url": "/orgs/github-api-test-org", + "url": "/user", "method": "GET" }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org-f1d03341-4c95-4c7f-9011-72db07f603a6.json", + "bodyFileName": "user-489e213c-810a-407d-b9aa-f7b00cdc8995.json", "headers": { - "Date": "Thu, 07 Nov 2019 00:29:51 GMT", + "Date": "Thu, 07 Nov 2019 05:19:26 GMT", "Content-Type": "application/json; charset=utf-8", "Server": "GitHub.com", "Status": "200 OK", "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4890", - "X-RateLimit-Reset": "1573089404", + "X-RateLimit-Remaining": "4936", + "X-RateLimit-Reset": "1573107045", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": [ "Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding" ], - "ETag": "W/\"4342e0e7004c1a50986c767513fe857d\"", - "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "ETag": "W/\"a789c1045b95bcbfa3f1d935ffbc801c\"", + "Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT", + "X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "", "X-GitHub-Media-Type": "unknown, github.v3", "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", "Access-Control-Allow-Origin": "*", @@ -32,10 +34,10 @@ "X-XSS-Protection": "1; mode=block", "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "9411:6B14:1318B73:15EE775:5DC3657E" + "X-GitHub-Request-Id": "EE66:9B40:1DDF971:2298B77:5DC3A95E" } }, - "uuid": "f1d03341-4c95-4c7f-9011-72db07f603a6", + "uuid": "489e213c-810a-407d-b9aa-f7b00cdc8995", "persistent": true, "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json deleted file mode 100644 index 99b5920ccb..0000000000 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/orgs_github-api-test-org-4331a09d-eb66-4384-a3cb-2079daa42258.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "login": "github-api-test-org", - "id": 7544739, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", - "url": "https://api.github.com/orgs/github-api-test-org", - "repos_url": "https://api.github.com/orgs/github-api-test-org/repos", - "events_url": "https://api.github.com/orgs/github-api-test-org/events", - "hooks_url": "https://api.github.com/orgs/github-api-test-org/hooks", - "issues_url": "https://api.github.com/orgs/github-api-test-org/issues", - "members_url": "https://api.github.com/orgs/github-api-test-org/members{/member}", - "public_members_url": "https://api.github.com/orgs/github-api-test-org/public_members{/member}", - "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", - "description": null, - "is_verified": false, - "has_organization_projects": true, - "has_repository_projects": true, - "public_repos": 10, - "public_gists": 0, - "followers": 0, - "following": 0, - "html_url": "https://github.com/github-api-test-org", - "created_at": "2014-05-10T19:39:11Z", - "updated_at": "2015-04-20T00:42:30Z", - "type": "Organization", - "total_private_repos": 0, - "owned_private_repos": 0, - "private_gists": 0, - "disk_usage": 132, - "collaborators": 0, - "billing_email": "kk@kohsuke.org", - "default_repository_permission": "none", - "members_can_create_repositories": false, - "two_factor_requirement_enabled": false, - "plan": { - "name": "free", - "space": 976562499, - "private_repos": 0, - "filled_seats": 7, - "seats": 0 - } -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json deleted file mode 100644 index 75cc867d6f..0000000000 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/__files/repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json +++ /dev/null @@ -1,330 +0,0 @@ -{ - "id": 206888201, - "node_id": "MDEwOlJlcG9zaXRvcnkyMDY4ODgyMDE=", - "name": "github-api", - "full_name": "github-api-test-org/github-api", - "private": false, - "owner": { - "login": "github-api-test-org", - "id": 7544739, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", - "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/github-api-test-org", - "html_url": "https://github.com/github-api-test-org", - "followers_url": "https://api.github.com/users/github-api-test-org/followers", - "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", - "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", - "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", - "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", - "repos_url": "https://api.github.com/users/github-api-test-org/repos", - "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", - "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/github-api-test-org/github-api", - "description": "Tricky", - "fork": true, - "url": "https://api.github.com/repos/github-api-test-org/github-api", - "forks_url": "https://api.github.com/repos/github-api-test-org/github-api/forks", - "keys_url": "https://api.github.com/repos/github-api-test-org/github-api/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/github-api-test-org/github-api/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/github-api-test-org/github-api/teams", - "hooks_url": "https://api.github.com/repos/github-api-test-org/github-api/hooks", - "issue_events_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/events{/number}", - "events_url": "https://api.github.com/repos/github-api-test-org/github-api/events", - "assignees_url": "https://api.github.com/repos/github-api-test-org/github-api/assignees{/user}", - "branches_url": "https://api.github.com/repos/github-api-test-org/github-api/branches{/branch}", - "tags_url": "https://api.github.com/repos/github-api-test-org/github-api/tags", - "blobs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/github-api-test-org/github-api/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/github-api-test-org/github-api/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/github-api-test-org/github-api/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/github-api-test-org/github-api/statuses/{sha}", - "languages_url": "https://api.github.com/repos/github-api-test-org/github-api/languages", - "stargazers_url": "https://api.github.com/repos/github-api-test-org/github-api/stargazers", - "contributors_url": "https://api.github.com/repos/github-api-test-org/github-api/contributors", - "subscribers_url": "https://api.github.com/repos/github-api-test-org/github-api/subscribers", - "subscription_url": "https://api.github.com/repos/github-api-test-org/github-api/subscription", - "commits_url": "https://api.github.com/repos/github-api-test-org/github-api/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/github-api-test-org/github-api/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/github-api-test-org/github-api/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/github-api-test-org/github-api/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/github-api-test-org/github-api/contents/{+path}", - "compare_url": "https://api.github.com/repos/github-api-test-org/github-api/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/github-api-test-org/github-api/merges", - "archive_url": "https://api.github.com/repos/github-api-test-org/github-api/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/github-api-test-org/github-api/downloads", - "issues_url": "https://api.github.com/repos/github-api-test-org/github-api/issues{/number}", - "pulls_url": "https://api.github.com/repos/github-api-test-org/github-api/pulls{/number}", - "milestones_url": "https://api.github.com/repos/github-api-test-org/github-api/milestones{/number}", - "notifications_url": "https://api.github.com/repos/github-api-test-org/github-api/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/github-api-test-org/github-api/labels{/name}", - "releases_url": "https://api.github.com/repos/github-api-test-org/github-api/releases{/id}", - "deployments_url": "https://api.github.com/repos/github-api-test-org/github-api/deployments", - "created_at": "2019-09-06T23:26:04Z", - "updated_at": "2019-11-07T00:25:40Z", - "pushed_at": "2019-10-21T22:34:49Z", - "git_url": "git://github.com/github-api-test-org/github-api.git", - "ssh_url": "git@github.com:github-api-test-org/github-api.git", - "clone_url": "https://github.com/github-api-test-org/github-api.git", - "svn_url": "https://github.com/github-api-test-org/github-api", - "homepage": "http://github-api.kohsuke.org/", - "size": 11391, - "stargazers_count": 0, - "watchers_count": 0, - "language": "Java", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": false, - "forks_count": 0, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 0, - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 0, - "open_issues": 0, - "watchers": 0, - "default_branch": "master", - "permissions": { - "admin": true, - "push": true, - "pull": true - }, - "allow_squash_merge": true, - "allow_merge_commit": true, - "allow_rebase_merge": true, - "organization": { - "login": "github-api-test-org", - "id": 7544739, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=", - "avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/github-api-test-org", - "html_url": "https://github.com/github-api-test-org", - "followers_url": "https://api.github.com/users/github-api-test-org/followers", - "following_url": "https://api.github.com/users/github-api-test-org/following{/other_user}", - "gists_url": "https://api.github.com/users/github-api-test-org/gists{/gist_id}", - "starred_url": "https://api.github.com/users/github-api-test-org/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/github-api-test-org/subscriptions", - "organizations_url": "https://api.github.com/users/github-api-test-org/orgs", - "repos_url": "https://api.github.com/users/github-api-test-org/repos", - "events_url": "https://api.github.com/users/github-api-test-org/events{/privacy}", - "received_events_url": "https://api.github.com/users/github-api-test-org/received_events", - "type": "Organization", - "site_admin": false - }, - "parent": { - "id": 617210, - "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", - "name": "github-api", - "full_name": "github-api/github-api", - "private": false, - "owner": { - "login": "github-api", - "id": 54909825, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", - "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/github-api", - "html_url": "https://github.com/github-api", - "followers_url": "https://api.github.com/users/github-api/followers", - "following_url": "https://api.github.com/users/github-api/following{/other_user}", - "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", - "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", - "organizations_url": "https://api.github.com/users/github-api/orgs", - "repos_url": "https://api.github.com/users/github-api/repos", - "events_url": "https://api.github.com/users/github-api/events{/privacy}", - "received_events_url": "https://api.github.com/users/github-api/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/github-api/github-api", - "description": "Java API for GitHub", - "fork": false, - "url": "https://api.github.com/repos/github-api/github-api", - "forks_url": "https://api.github.com/repos/github-api/github-api/forks", - "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/github-api/github-api/teams", - "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", - "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", - "events_url": "https://api.github.com/repos/github-api/github-api/events", - "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", - "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", - "tags_url": "https://api.github.com/repos/github-api/github-api/tags", - "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", - "languages_url": "https://api.github.com/repos/github-api/github-api/languages", - "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", - "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", - "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", - "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", - "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", - "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/github-api/github-api/merges", - "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", - "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", - "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", - "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", - "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", - "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", - "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", - "created_at": "2010-04-19T04:13:03Z", - "updated_at": "2019-11-06T12:09:45Z", - "pushed_at": "2019-11-06T07:12:42Z", - "git_url": "git://github.com/github-api/github-api.git", - "ssh_url": "git@github.com:github-api/github-api.git", - "clone_url": "https://github.com/github-api/github-api.git", - "svn_url": "https://github.com/github-api/github-api", - "homepage": "http://github-api.kohsuke.org/", - "size": 15301, - "stargazers_count": 575, - "watchers_count": 575, - "language": "Java", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 437, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 57, - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 437, - "open_issues": 57, - "watchers": 575, - "default_branch": "master" - }, - "source": { - "id": 617210, - "node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=", - "name": "github-api", - "full_name": "github-api/github-api", - "private": false, - "owner": { - "login": "github-api", - "id": 54909825, - "node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1", - "avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4", - "gravatar_id": "", - "url": "https://api.github.com/users/github-api", - "html_url": "https://github.com/github-api", - "followers_url": "https://api.github.com/users/github-api/followers", - "following_url": "https://api.github.com/users/github-api/following{/other_user}", - "gists_url": "https://api.github.com/users/github-api/gists{/gist_id}", - "starred_url": "https://api.github.com/users/github-api/starred{/owner}{/repo}", - "subscriptions_url": "https://api.github.com/users/github-api/subscriptions", - "organizations_url": "https://api.github.com/users/github-api/orgs", - "repos_url": "https://api.github.com/users/github-api/repos", - "events_url": "https://api.github.com/users/github-api/events{/privacy}", - "received_events_url": "https://api.github.com/users/github-api/received_events", - "type": "Organization", - "site_admin": false - }, - "html_url": "https://github.com/github-api/github-api", - "description": "Java API for GitHub", - "fork": false, - "url": "https://api.github.com/repos/github-api/github-api", - "forks_url": "https://api.github.com/repos/github-api/github-api/forks", - "keys_url": "https://api.github.com/repos/github-api/github-api/keys{/key_id}", - "collaborators_url": "https://api.github.com/repos/github-api/github-api/collaborators{/collaborator}", - "teams_url": "https://api.github.com/repos/github-api/github-api/teams", - "hooks_url": "https://api.github.com/repos/github-api/github-api/hooks", - "issue_events_url": "https://api.github.com/repos/github-api/github-api/issues/events{/number}", - "events_url": "https://api.github.com/repos/github-api/github-api/events", - "assignees_url": "https://api.github.com/repos/github-api/github-api/assignees{/user}", - "branches_url": "https://api.github.com/repos/github-api/github-api/branches{/branch}", - "tags_url": "https://api.github.com/repos/github-api/github-api/tags", - "blobs_url": "https://api.github.com/repos/github-api/github-api/git/blobs{/sha}", - "git_tags_url": "https://api.github.com/repos/github-api/github-api/git/tags{/sha}", - "git_refs_url": "https://api.github.com/repos/github-api/github-api/git/refs{/sha}", - "trees_url": "https://api.github.com/repos/github-api/github-api/git/trees{/sha}", - "statuses_url": "https://api.github.com/repos/github-api/github-api/statuses/{sha}", - "languages_url": "https://api.github.com/repos/github-api/github-api/languages", - "stargazers_url": "https://api.github.com/repos/github-api/github-api/stargazers", - "contributors_url": "https://api.github.com/repos/github-api/github-api/contributors", - "subscribers_url": "https://api.github.com/repos/github-api/github-api/subscribers", - "subscription_url": "https://api.github.com/repos/github-api/github-api/subscription", - "commits_url": "https://api.github.com/repos/github-api/github-api/commits{/sha}", - "git_commits_url": "https://api.github.com/repos/github-api/github-api/git/commits{/sha}", - "comments_url": "https://api.github.com/repos/github-api/github-api/comments{/number}", - "issue_comment_url": "https://api.github.com/repos/github-api/github-api/issues/comments{/number}", - "contents_url": "https://api.github.com/repos/github-api/github-api/contents/{+path}", - "compare_url": "https://api.github.com/repos/github-api/github-api/compare/{base}...{head}", - "merges_url": "https://api.github.com/repos/github-api/github-api/merges", - "archive_url": "https://api.github.com/repos/github-api/github-api/{archive_format}{/ref}", - "downloads_url": "https://api.github.com/repos/github-api/github-api/downloads", - "issues_url": "https://api.github.com/repos/github-api/github-api/issues{/number}", - "pulls_url": "https://api.github.com/repos/github-api/github-api/pulls{/number}", - "milestones_url": "https://api.github.com/repos/github-api/github-api/milestones{/number}", - "notifications_url": "https://api.github.com/repos/github-api/github-api/notifications{?since,all,participating}", - "labels_url": "https://api.github.com/repos/github-api/github-api/labels{/name}", - "releases_url": "https://api.github.com/repos/github-api/github-api/releases{/id}", - "deployments_url": "https://api.github.com/repos/github-api/github-api/deployments", - "created_at": "2010-04-19T04:13:03Z", - "updated_at": "2019-11-06T12:09:45Z", - "pushed_at": "2019-11-06T07:12:42Z", - "git_url": "git://github.com/github-api/github-api.git", - "ssh_url": "git@github.com:github-api/github-api.git", - "clone_url": "https://github.com/github-api/github-api.git", - "svn_url": "https://github.com/github-api/github-api", - "homepage": "http://github-api.kohsuke.org/", - "size": 15301, - "stargazers_count": 575, - "watchers_count": 575, - "language": "Java", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 437, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 57, - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 437, - "open_issues": 57, - "watchers": 575, - "default_branch": "master" - }, - "network_count": 437, - "subscribers_count": 0 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api-2-b4e70c.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api-2-b4e70c.json deleted file mode 100644 index f5c5db5d61..0000000000 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/testSetTopicsEmpty/mappings/repos_github-api-test-org_github-api-2-b4e70c.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "id": "b4e70cca-45b0-408c-a1a6-3ade8b992016", - "name": "repos_github-api-test-org_github-api", - "request": { - "url": "/repos/github-api-test-org/github-api", - "method": "GET" - }, - "response": { - "status": 200, - "bodyFileName": "repos_github-api-test-org_github-api-b4e70cca-45b0-408c-a1a6-3ade8b992016.json", - "headers": { - "Date": "Thu, 07 Nov 2019 00:29:49 GMT", - "Content-Type": "application/json; charset=utf-8", - "Server": "GitHub.com", - "Status": "200 OK", - "X-RateLimit-Limit": "5000", - "X-RateLimit-Remaining": "4893", - "X-RateLimit-Reset": "1573089404", - "Cache-Control": "private, max-age=60, s-maxage=60", - "Vary": [ - "Accept, Authorization, Cookie, X-GitHub-OTP", - "Accept-Encoding" - ], - "ETag": "W/\"3bc6d84ee238bda95a4728ca523fda9f\"", - "Last-Modified": "Thu, 07 Nov 2019 00:25:40 GMT", - "X-GitHub-Media-Type": "unknown, github.v3", - "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", - "Access-Control-Allow-Origin": "*", - "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", - "X-Frame-Options": "deny", - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", - "Content-Security-Policy": "default-src 'none'", - "X-GitHub-Request-Id": "940A:4537:12DFD3F:15B987F:5DC3657C" - } - }, - "uuid": "b4e70cca-45b0-408c-a1a6-3ade8b992016", - "persistent": true, - "insertionIndex": 2 -} \ No newline at end of file