From 5aad5406a25a015ecb09267def8b1fce61257a2a Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Tue, 21 Jan 2020 14:35:29 -0500 Subject: [PATCH 1/3] [WIP]Adding GHRepo tests --- .../org/kohsuke/github/GHRepositoryTest.java | 16 + ...-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json | 25 ++ ...-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json | 323 ++++++++++++++++++ .../orgs_github-api-test-org-1-006658.json | 43 +++ ...thub-api-test-org_github-api-2-933c14.json | 43 +++ ...-05a87d46-e21e-4b39-90fa-9ecf2906e550.json | 25 ++ ...-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json | 323 ++++++++++++++++++ .../orgs_github-api-test-org-1-05a87d.json | 43 +++ ...thub-api-test-org_github-api-2-79fc54.json | 43 +++ 9 files changed, 884 insertions(+) create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/orgs_github-api-test-org-1-006658.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_github-api-2-933c14.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/orgs_github-api-test-org-05a87d46-e21e-4b39-90fa-9ecf2906e550.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/orgs_github-api-test-org-1-05a87d.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_github-api-2-79fc54.json diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index ad15b6b32b..83166f0697 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -424,4 +424,20 @@ public void listTags() throws Exception { assertThat(refs, notNullValue()); assertThat(refs.size(), greaterThan(90)); } + + @Test + public void checkWatchersCount() throws Exception { + GHRepository repo = getRepository(); + int watchersCount = repo.getWatchers(); + assertNotEquals(null, watchersCount); + assertEquals(10, watchersCount); + } + + @Test + public void checkStargazersCount() throws Exception { + GHRepository repo = getRepository(); + int stargazersCount = repo.getStargazersCount(); + assertNotEquals(null, stargazersCount); + assertEquals(10, stargazersCount); + } } diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json new file mode 100644 index 0000000000..d4554f3bc1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json @@ -0,0 +1,25 @@ +{ + "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": 11, + "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" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json new file mode 100644 index 0000000000..a7d163ac2c --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json @@ -0,0 +1,323 @@ +{ + "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": "2020-01-16T21:22:56Z", + "pushed_at": "2020-01-18T00:47:43Z", + "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": 11414, + "stargazers_count": 10, + "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", + "temp_clone_token": null, + "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": "2020-01-19T02:54:19Z", + "pushed_at": "2020-01-19T02:54:17Z", + "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": 17948, + "stargazers_count": 602, + "watchers_count": 602, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 445, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 54, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 445, + "open_issues": 54, + "watchers": 602, + "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": "2020-01-19T02:54:19Z", + "pushed_at": "2020-01-19T02:54:17Z", + "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": 17948, + "stargazers_count": 602, + "watchers_count": 602, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 445, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 54, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 445, + "open_issues": 54, + "watchers": 602, + "default_branch": "master" + }, + "network_count": 445, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/orgs_github-api-test-org-1-006658.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/orgs_github-api-test-org-1-006658.json new file mode 100644 index 0000000000..fbde75c9ba --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/orgs_github-api-test-org-1-006658.json @@ -0,0 +1,43 @@ +{ + "id": "00665825-e0e1-4b21-9d8b-f0c537fd82f3", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 21 Jan 2020 18:17:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "51", + "X-RateLimit-Reset": "1579634248", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": "Accept", + "ETag": "W/\"344d9b542c3151b1973817461b0b7c48\"", + "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": "FB1E:45BB:4F39BF:A04E34:5E274038" + } + }, + "uuid": "00665825-e0e1-4b21-9d8b-f0c537fd82f3", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_github-api-2-933c14.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_github-api-2-933c14.json new file mode 100644 index 0000000000..c0826a5496 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_github-api-2-933c14.json @@ -0,0 +1,43 @@ +{ + "id": "933c1407-de7c-4ee5-b7bd-53e23d026ddc", + "name": "repos_github-api-test-org_github-api", + "request": { + "url": "/repos/github-api-test-org/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 21 Jan 2020 18:17:29 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "50", + "X-RateLimit-Reset": "1579634248", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": "Accept", + "ETag": "W/\"bba27de56ef2fbe411f3c61b417f5637\"", + "Last-Modified": "Thu, 16 Jan 2020 21:22:56 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": "FB1E:45BB:4F39C4:A04E3D:5E274039" + } + }, + "uuid": "933c1407-de7c-4ee5-b7bd-53e23d026ddc", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/orgs_github-api-test-org-05a87d46-e21e-4b39-90fa-9ecf2906e550.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/orgs_github-api-test-org-05a87d46-e21e-4b39-90fa-9ecf2906e550.json new file mode 100644 index 0000000000..d4554f3bc1 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/orgs_github-api-test-org-05a87d46-e21e-4b39-90fa-9ecf2906e550.json @@ -0,0 +1,25 @@ +{ + "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": 11, + "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" +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json new file mode 100644 index 0000000000..ec6e2d6ee2 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json @@ -0,0 +1,323 @@ +{ + "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": "2020-01-16T21:22:56Z", + "pushed_at": "2020-01-18T00:47:43Z", + "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": 11414, + "stargazers_count": 0, + "watchers_count": 10, + "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", + "temp_clone_token": null, + "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": "2020-01-19T02:54:19Z", + "pushed_at": "2020-01-19T02:54:17Z", + "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": 17948, + "stargazers_count": 602, + "watchers_count": 602, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 445, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 54, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 445, + "open_issues": 54, + "watchers": 602, + "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": "2020-01-19T02:54:19Z", + "pushed_at": "2020-01-19T02:54:17Z", + "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": 17948, + "stargazers_count": 602, + "watchers_count": 602, + "language": "Java", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 445, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 54, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "forks": 445, + "open_issues": 54, + "watchers": 602, + "default_branch": "master" + }, + "network_count": 445, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/orgs_github-api-test-org-1-05a87d.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/orgs_github-api-test-org-1-05a87d.json new file mode 100644 index 0000000000..a902c601cf --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/orgs_github-api-test-org-1-05a87d.json @@ -0,0 +1,43 @@ +{ + "id": "05a87d46-e21e-4b39-90fa-9ecf2906e550", + "name": "orgs_github-api-test-org", + "request": { + "url": "/orgs/github-api-test-org", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "orgs_github-api-test-org-05a87d46-e21e-4b39-90fa-9ecf2906e550.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 21 Jan 2020 18:17:31 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "25", + "X-RateLimit-Reset": "1579634247", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": "Accept", + "ETag": "W/\"344d9b542c3151b1973817461b0b7c48\"", + "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": "FB78:0DBB:5534D2:AEDB99:5E27403B" + } + }, + "uuid": "05a87d46-e21e-4b39-90fa-9ecf2906e550", + "persistent": true, + "insertionIndex": 1 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_github-api-2-79fc54.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_github-api-2-79fc54.json new file mode 100644 index 0000000000..f01061a23f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_github-api-2-79fc54.json @@ -0,0 +1,43 @@ +{ + "id": "79fc544b-0a3a-4675-b1e8-53e1fe02cffa", + "name": "repos_github-api-test-org_github-api", + "request": { + "url": "/repos/github-api-test-org/github-api", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json", + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 21 Jan 2020 18:17:32 GMT", + "Content-Type": "application/json; charset=utf-8", + "Status": "200 OK", + "X-RateLimit-Limit": "60", + "X-RateLimit-Remaining": "24", + "X-RateLimit-Reset": "1579634248", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": "Accept", + "ETag": "W/\"bba27de56ef2fbe411f3c61b417f5637\"", + "Last-Modified": "Thu, 16 Jan 2020 21:22:56 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": "FB78:0DBB:5534D6:AEDBA6:5E27403B" + } + }, + "uuid": "79fc544b-0a3a-4675-b1e8-53e1fe02cffa", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file From 473f3954c7f59633a8622f8484df656d8619d138 Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Tue, 21 Jan 2020 15:56:07 -0500 Subject: [PATCH 2/3] Update GHRepositoryTest.java Added some parent tests as well --- src/test/java/org/kohsuke/github/GHRepositoryTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 83166f0697..88b3595eed 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -427,17 +427,23 @@ public void listTags() throws Exception { @Test public void checkWatchersCount() throws Exception { + snapshotNotAllowed(); GHRepository repo = getRepository(); + GHRepository parent = repo.getParent(); int watchersCount = repo.getWatchers(); - assertNotEquals(null, watchersCount); + int watchersCountParent = parent.getWatchers(); assertEquals(10, watchersCount); + assertEquals(602, watchersCountParent); } @Test public void checkStargazersCount() throws Exception { + snapshotNotAllowed(); GHRepository repo = getRepository(); + GHRepository parent = repo.getParent(); int stargazersCount = repo.getStargazersCount(); - assertNotEquals(null, stargazersCount); + int stargazersCountParent = parent.getWatchers(); assertEquals(10, stargazersCount); + assertEquals(602, stargazersCountParent); } } From a65783201e2092fa8498f75f5b0cff41f14d767d Mon Sep 17 00:00:00 2001 From: Alex Taylor Date: Thu, 23 Jan 2020 15:31:50 -0500 Subject: [PATCH 3/3] updated the test files Updated the test files and did a temp repo --- .../org/kohsuke/github/GHRepositoryTest.java | 10 +- ...-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json | 25 -- ...-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json | 323 ------------------ ...-bd22f750-1a7c-4274-b5d6-9e2164a1eb2a.json | 126 +++++++ ...-ebb96197-f82b-4a05-87e8-932107fd594e.json | 45 +++ ...thub-api-test-org_github-api-2-933c14.json | 43 --- ...g_temp-checkstargazerscount-2-bd22f7.json} | 30 +- ...t-org-1-006658.json => user-1-ebb961.json} | 30 +- ...-05a87d46-e21e-4b39-90fa-9ecf2906e550.json | 25 -- ...-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json | 323 ------------------ ...-480b7f68-9bb9-4443-b01f-d617b71fd015.json | 126 +++++++ ...-2d950c1e-78e1-4883-af14-378fee1e9454.json | 45 +++ ...-org_temp-checkwatcherscount-2-480b7f.json | 49 +++ 13 files changed, 425 insertions(+), 775 deletions(-) delete mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json delete mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_temp-checkstargazerscount-bd22f750-1a7c-4274-b5d6-9e2164a1eb2a.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/user-ebb96197-f82b-4a05-87e8-932107fd594e.json delete mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_github-api-2-933c14.json rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/{checkWatchersCount/mappings/repos_github-api-test-org_github-api-2-79fc54.json => checkStargazersCount/mappings/repos_github-api-test-org_temp-checkstargazerscount-2-bd22f7.json} (50%) rename src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/{orgs_github-api-test-org-1-006658.json => user-1-ebb961.json} (54%) delete mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/orgs_github-api-test-org-05a87d46-e21e-4b39-90fa-9ecf2906e550.json delete mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_temp-checkwatcherscount-480b7f68-9bb9-4443-b01f-d617b71fd015.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/user-2d950c1e-78e1-4883-af14-378fee1e9454.json create mode 100644 src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_temp-checkwatcherscount-2-480b7f.json diff --git a/src/test/java/org/kohsuke/github/GHRepositoryTest.java b/src/test/java/org/kohsuke/github/GHRepositoryTest.java index 88b3595eed..9508978eb1 100644 --- a/src/test/java/org/kohsuke/github/GHRepositoryTest.java +++ b/src/test/java/org/kohsuke/github/GHRepositoryTest.java @@ -428,22 +428,16 @@ public void listTags() throws Exception { @Test public void checkWatchersCount() throws Exception { snapshotNotAllowed(); - GHRepository repo = getRepository(); - GHRepository parent = repo.getParent(); + GHRepository repo = getTempRepository(); int watchersCount = repo.getWatchers(); - int watchersCountParent = parent.getWatchers(); assertEquals(10, watchersCount); - assertEquals(602, watchersCountParent); } @Test public void checkStargazersCount() throws Exception { snapshotNotAllowed(); - GHRepository repo = getRepository(); - GHRepository parent = repo.getParent(); + GHRepository repo = getTempRepository(); int stargazersCount = repo.getStargazersCount(); - int stargazersCountParent = parent.getWatchers(); assertEquals(10, stargazersCount); - assertEquals(602, stargazersCountParent); } } diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json deleted file mode 100644 index d4554f3bc1..0000000000 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json +++ /dev/null @@ -1,25 +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": 11, - "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" -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json deleted file mode 100644 index a7d163ac2c..0000000000 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json +++ /dev/null @@ -1,323 +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": "2020-01-16T21:22:56Z", - "pushed_at": "2020-01-18T00:47:43Z", - "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": 11414, - "stargazers_count": 10, - "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", - "temp_clone_token": null, - "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": "2020-01-19T02:54:19Z", - "pushed_at": "2020-01-19T02:54:17Z", - "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": 17948, - "stargazers_count": 602, - "watchers_count": 602, - "language": "Java", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 445, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 54, - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 445, - "open_issues": 54, - "watchers": 602, - "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": "2020-01-19T02:54:19Z", - "pushed_at": "2020-01-19T02:54:17Z", - "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": 17948, - "stargazers_count": 602, - "watchers_count": 602, - "language": "Java", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 445, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 54, - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 445, - "open_issues": 54, - "watchers": 602, - "default_branch": "master" - }, - "network_count": 445, - "subscribers_count": 0 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_temp-checkstargazerscount-bd22f750-1a7c-4274-b5d6-9e2164a1eb2a.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_temp-checkstargazerscount-bd22f750-1a7c-4274-b5d6-9e2164a1eb2a.json new file mode 100644 index 0000000000..c02f3e59e4 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/repos_github-api-test-org_temp-checkstargazerscount-bd22f750-1a7c-4274-b5d6-9e2164a1eb2a.json @@ -0,0 +1,126 @@ +{ + "id": 235867827, + "node_id": "MDEwOlJlcG9zaXRvcnkyMzU4Njc4Mjc=", + "name": "temp-checkStargazersCount", + "full_name": "github-api-test-org/temp-checkStargazersCount", + "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/temp-checkStargazersCount", + "description": "A test repository for testing the github-api project: temp-checkStargazersCount", + "fork": false, + "url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount", + "forks_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/temp-checkStargazersCount/deployments", + "created_at": "2020-01-23T19:16:16Z", + "updated_at": "2020-01-23T19:16:20Z", + "pushed_at": "2020-01-23T19:16:18Z", + "git_url": "git://github.com/github-api-test-org/temp-checkStargazersCount.git", + "ssh_url": "git@github.com:github-api-test-org/temp-checkStargazersCount.git", + "clone_url": "https://github.com/github-api-test-org/temp-checkStargazersCount.git", + "svn_url": "https://github.com/github-api-test-org/temp-checkStargazersCount", + "homepage": "http://github-api.kohsuke.org/", + "size": 0, + "stargazers_count": 10, + "watchers_count": 0, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false, + "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 + }, + "network_count": 0, + "subscribers_count": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/user-ebb96197-f82b-4a05-87e8-932107fd594e.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/user-ebb96197-f82b-4a05-87e8-932107fd594e.json new file mode 100644 index 0000000000..c0cf6a3a30 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/__files/user-ebb96197-f82b-4a05-87e8-932107fd594e.json @@ -0,0 +1,45 @@ +{ + "login": "alexanderrtaylor", + "id": 852179, + "node_id": "MDQ6VXNlcjg1MjE3OQ==", + "avatar_url": "https://avatars0.githubusercontent.com/u/852179?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/alexanderrtaylor", + "html_url": "https://github.com/alexanderrtaylor", + "followers_url": "https://api.github.com/users/alexanderrtaylor/followers", + "following_url": "https://api.github.com/users/alexanderrtaylor/following{/other_user}", + "gists_url": "https://api.github.com/users/alexanderrtaylor/gists{/gist_id}", + "starred_url": "https://api.github.com/users/alexanderrtaylor/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/alexanderrtaylor/subscriptions", + "organizations_url": "https://api.github.com/users/alexanderrtaylor/orgs", + "repos_url": "https://api.github.com/users/alexanderrtaylor/repos", + "events_url": "https://api.github.com/users/alexanderrtaylor/events{/privacy}", + "received_events_url": "https://api.github.com/users/alexanderrtaylor/received_events", + "type": "User", + "site_admin": false, + "name": "Alex Taylor", + "company": "Cloudbees", + "blog": "", + "location": null, + "email": null, + "hireable": null, + "bio": "This is the Way", + "public_repos": 40, + "public_gists": 1, + "followers": 5, + "following": 0, + "created_at": "2011-06-15T16:35:58Z", + "updated_at": "2020-01-10T13:31:02Z", + "private_gists": 1, + "total_private_repos": 15, + "owned_private_repos": 0, + "disk_usage": 277, + "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/checkStargazersCount/mappings/repos_github-api-test-org_github-api-2-933c14.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_github-api-2-933c14.json deleted file mode 100644 index c0826a5496..0000000000 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_github-api-2-933c14.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "id": "933c1407-de7c-4ee5-b7bd-53e23d026ddc", - "name": "repos_github-api-test-org_github-api", - "request": { - "url": "/repos/github-api-test-org/github-api", - "method": "GET", - "headers": { - "Accept": { - "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - } - } - }, - "response": { - "status": 200, - "bodyFileName": "repos_github-api-test-org_github-api-933c1407-de7c-4ee5-b7bd-53e23d026ddc.json", - "headers": { - "Server": "GitHub.com", - "Date": "Tue, 21 Jan 2020 18:17:29 GMT", - "Content-Type": "application/json; charset=utf-8", - "Status": "200 OK", - "X-RateLimit-Limit": "60", - "X-RateLimit-Remaining": "50", - "X-RateLimit-Reset": "1579634248", - "Cache-Control": "public, max-age=60, s-maxage=60", - "Vary": "Accept", - "ETag": "W/\"bba27de56ef2fbe411f3c61b417f5637\"", - "Last-Modified": "Thu, 16 Jan 2020 21:22:56 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": "FB1E:45BB:4F39C4:A04E3D:5E274039" - } - }, - "uuid": "933c1407-de7c-4ee5-b7bd-53e23d026ddc", - "persistent": true, - "insertionIndex": 2 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_github-api-2-79fc54.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_temp-checkstargazerscount-2-bd22f7.json similarity index 50% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_github-api-2-79fc54.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_temp-checkstargazerscount-2-bd22f7.json index f01061a23f..5736687456 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_github-api-2-79fc54.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/repos_github-api-test-org_temp-checkstargazerscount-2-bd22f7.json @@ -1,8 +1,8 @@ { - "id": "79fc544b-0a3a-4675-b1e8-53e1fe02cffa", - "name": "repos_github-api-test-org_github-api", + "id": "bd22f750-1a7c-4274-b5d6-9e2164a1eb2a", + "name": "repos_github-api-test-org_temp-checkstargazerscount", "request": { - "url": "/repos/github-api-test-org/github-api", + "url": "/repos/github-api-test-org/temp-checkStargazersCount", "method": "GET", "headers": { "Accept": { @@ -12,19 +12,21 @@ }, "response": { "status": 200, - "bodyFileName": "repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json", + "bodyFileName": "repos_github-api-test-org_temp-checkstargazerscount-bd22f750-1a7c-4274-b5d6-9e2164a1eb2a.json", "headers": { "Server": "GitHub.com", - "Date": "Tue, 21 Jan 2020 18:17:32 GMT", + "Date": "Thu, 23 Jan 2020 19:16:21 GMT", "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", - "X-RateLimit-Limit": "60", - "X-RateLimit-Remaining": "24", - "X-RateLimit-Reset": "1579634248", - "Cache-Control": "public, max-age=60, s-maxage=60", - "Vary": "Accept", - "ETag": "W/\"bba27de56ef2fbe411f3c61b417f5637\"", - "Last-Modified": "Thu, 16 Jan 2020 21:22:56 GMT", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4920", + "X-RateLimit-Reset": "1579808711", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"f30e5b1563a06b458b3e7337252b42c1\"", + "Last-Modified": "Thu, 23 Jan 2020 19:16:20 GMT", + "X-OAuth-Scopes": "admin:gpg_key, 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": "*", @@ -34,10 +36,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": "FB78:0DBB:5534D6:AEDBA6:5E27403B" + "X-GitHub-Request-Id": "FDD6:6F1D:4BF06C:BD9B80:5E29F0FF" } }, - "uuid": "79fc544b-0a3a-4675-b1e8-53e1fe02cffa", + "uuid": "bd22f750-1a7c-4274-b5d6-9e2164a1eb2a", "persistent": true, "insertionIndex": 2 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/orgs_github-api-test-org-1-006658.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/user-1-ebb961.json similarity index 54% rename from src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/orgs_github-api-test-org-1-006658.json rename to src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/user-1-ebb961.json index fbde75c9ba..4c8fadf7ce 100644 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/orgs_github-api-test-org-1-006658.json +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkStargazersCount/mappings/user-1-ebb961.json @@ -1,8 +1,8 @@ { - "id": "00665825-e0e1-4b21-9d8b-f0c537fd82f3", - "name": "orgs_github-api-test-org", + "id": "ebb96197-f82b-4a05-87e8-932107fd594e", + "name": "user", "request": { - "url": "/orgs/github-api-test-org", + "url": "/user", "method": "GET", "headers": { "Accept": { @@ -12,19 +12,21 @@ }, "response": { "status": 200, - "bodyFileName": "orgs_github-api-test-org-00665825-e0e1-4b21-9d8b-f0c537fd82f3.json", + "bodyFileName": "user-ebb96197-f82b-4a05-87e8-932107fd594e.json", "headers": { "Server": "GitHub.com", - "Date": "Tue, 21 Jan 2020 18:17:29 GMT", + "Date": "Thu, 23 Jan 2020 19:16:15 GMT", "Content-Type": "application/json; charset=utf-8", "Status": "200 OK", - "X-RateLimit-Limit": "60", - "X-RateLimit-Remaining": "51", - "X-RateLimit-Reset": "1579634248", - "Cache-Control": "public, max-age=60, s-maxage=60", - "Vary": "Accept", - "ETag": "W/\"344d9b542c3151b1973817461b0b7c48\"", - "Last-Modified": "Mon, 20 Apr 2015 00:42:30 GMT", + "X-RateLimit-Limit": "5000", + "X-RateLimit-Remaining": "4925", + "X-RateLimit-Reset": "1579808711", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", + "ETag": "W/\"12d1d56c145aab04375c00af287e9ef0\"", + "Last-Modified": "Fri, 10 Jan 2020 13:31:02 GMT", + "X-OAuth-Scopes": "admin:gpg_key, 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": "*", @@ -34,10 +36,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": "FB1E:45BB:4F39BF:A04E34:5E274038" + "X-GitHub-Request-Id": "FDD6:6F1D:4BEF7C:BD9B79:5E29F0FF" } }, - "uuid": "00665825-e0e1-4b21-9d8b-f0c537fd82f3", + "uuid": "ebb96197-f82b-4a05-87e8-932107fd594e", "persistent": true, "insertionIndex": 1 } \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/orgs_github-api-test-org-05a87d46-e21e-4b39-90fa-9ecf2906e550.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/orgs_github-api-test-org-05a87d46-e21e-4b39-90fa-9ecf2906e550.json deleted file mode 100644 index d4554f3bc1..0000000000 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/orgs_github-api-test-org-05a87d46-e21e-4b39-90fa-9ecf2906e550.json +++ /dev/null @@ -1,25 +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": 11, - "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" -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json deleted file mode 100644 index ec6e2d6ee2..0000000000 --- a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_github-api-79fc544b-0a3a-4675-b1e8-53e1fe02cffa.json +++ /dev/null @@ -1,323 +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": "2020-01-16T21:22:56Z", - "pushed_at": "2020-01-18T00:47:43Z", - "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": 11414, - "stargazers_count": 0, - "watchers_count": 10, - "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", - "temp_clone_token": null, - "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": "2020-01-19T02:54:19Z", - "pushed_at": "2020-01-19T02:54:17Z", - "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": 17948, - "stargazers_count": 602, - "watchers_count": 602, - "language": "Java", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 445, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 54, - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 445, - "open_issues": 54, - "watchers": 602, - "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": "2020-01-19T02:54:19Z", - "pushed_at": "2020-01-19T02:54:17Z", - "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": 17948, - "stargazers_count": 602, - "watchers_count": 602, - "language": "Java", - "has_issues": true, - "has_projects": true, - "has_downloads": true, - "has_wiki": true, - "has_pages": true, - "forks_count": 445, - "mirror_url": null, - "archived": false, - "disabled": false, - "open_issues_count": 54, - "license": { - "key": "mit", - "name": "MIT License", - "spdx_id": "MIT", - "url": "https://api.github.com/licenses/mit", - "node_id": "MDc6TGljZW5zZTEz" - }, - "forks": 445, - "open_issues": 54, - "watchers": 602, - "default_branch": "master" - }, - "network_count": 445, - "subscribers_count": 0 -} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_temp-checkwatcherscount-480b7f68-9bb9-4443-b01f-d617b71fd015.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_temp-checkwatcherscount-480b7f68-9bb9-4443-b01f-d617b71fd015.json new file mode 100644 index 0000000000..3bc595fdf0 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/repos_github-api-test-org_temp-checkwatcherscount-480b7f68-9bb9-4443-b01f-d617b71fd015.json @@ -0,0 +1,126 @@ +{ + "id": 235867740, + "node_id": "MDEwOlJlcG9zaXRvcnkyMzU4Njc3NDA=", + "name": "temp-checkWatchersCount", + "full_name": "github-api-test-org/temp-checkWatchersCount", + "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/temp-checkWatchersCount", + "description": "A test repository for testing the github-api project: temp-checkWatchersCount", + "fork": false, + "url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount", + "forks_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/forks", + "keys_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/teams", + "hooks_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/hooks", + "issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/issues/events{/number}", + "events_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/events", + "assignees_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/assignees{/user}", + "branches_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/branches{/branch}", + "tags_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/tags", + "blobs_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/statuses/{sha}", + "languages_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/languages", + "stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/stargazers", + "contributors_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/contributors", + "subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/subscribers", + "subscription_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/subscription", + "commits_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/contents/{+path}", + "compare_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/merges", + "archive_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/downloads", + "issues_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/issues{/number}", + "pulls_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/pulls{/number}", + "milestones_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/milestones{/number}", + "notifications_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/labels{/name}", + "releases_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/releases{/id}", + "deployments_url": "https://api.github.com/repos/github-api-test-org/temp-checkWatchersCount/deployments", + "created_at": "2020-01-23T19:15:46Z", + "updated_at": "2020-01-23T19:15:50Z", + "pushed_at": "2020-01-23T19:15:48Z", + "git_url": "git://github.com/github-api-test-org/temp-checkWatchersCount.git", + "ssh_url": "git@github.com:github-api-test-org/temp-checkWatchersCount.git", + "clone_url": "https://github.com/github-api-test-org/temp-checkWatchersCount.git", + "svn_url": "https://github.com/github-api-test-org/temp-checkWatchersCount", + "homepage": "http://github-api.kohsuke.org/", + "size": 0, + "stargazers_count": 0, + "watchers_count": 10, + "language": null, + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": true, + "push": true, + "pull": true + }, + "temp_clone_token": "", + "allow_squash_merge": true, + "allow_merge_commit": true, + "allow_rebase_merge": true, + "delete_branch_on_merge": false, + "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 + }, + "network_count": 0, + "subscribers_count": 6 +} \ No newline at end of file diff --git a/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/user-2d950c1e-78e1-4883-af14-378fee1e9454.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/user-2d950c1e-78e1-4883-af14-378fee1e9454.json new file mode 100644 index 0000000000..c0cf6a3a30 --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/__files/user-2d950c1e-78e1-4883-af14-378fee1e9454.json @@ -0,0 +1,45 @@ +{ + "login": "alexanderrtaylor", + "id": 852179, + "node_id": "MDQ6VXNlcjg1MjE3OQ==", + "avatar_url": "https://avatars0.githubusercontent.com/u/852179?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/alexanderrtaylor", + "html_url": "https://github.com/alexanderrtaylor", + "followers_url": "https://api.github.com/users/alexanderrtaylor/followers", + "following_url": "https://api.github.com/users/alexanderrtaylor/following{/other_user}", + "gists_url": "https://api.github.com/users/alexanderrtaylor/gists{/gist_id}", + "starred_url": "https://api.github.com/users/alexanderrtaylor/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/alexanderrtaylor/subscriptions", + "organizations_url": "https://api.github.com/users/alexanderrtaylor/orgs", + "repos_url": "https://api.github.com/users/alexanderrtaylor/repos", + "events_url": "https://api.github.com/users/alexanderrtaylor/events{/privacy}", + "received_events_url": "https://api.github.com/users/alexanderrtaylor/received_events", + "type": "User", + "site_admin": false, + "name": "Alex Taylor", + "company": "Cloudbees", + "blog": "", + "location": null, + "email": null, + "hireable": null, + "bio": "This is the Way", + "public_repos": 40, + "public_gists": 1, + "followers": 5, + "following": 0, + "created_at": "2011-06-15T16:35:58Z", + "updated_at": "2020-01-10T13:31:02Z", + "private_gists": 1, + "total_private_repos": 15, + "owned_private_repos": 0, + "disk_usage": 277, + "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/checkWatchersCount/mappings/repos_github-api-test-org_temp-checkwatcherscount-2-480b7f.json b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_temp-checkwatcherscount-2-480b7f.json new file mode 100644 index 0000000000..e0b0e2d94f --- /dev/null +++ b/src/test/resources/org/kohsuke/github/GHRepositoryTest/wiremock/checkWatchersCount/mappings/repos_github-api-test-org_temp-checkwatcherscount-2-480b7f.json @@ -0,0 +1,49 @@ +{ + "id": "480b7f68-9bb9-4443-b01f-d617b71fd015", + "name": "repos_github-api-test-org_temp-checkwatcherscount", + "request": { + "url": "/repos/github-api-test-org/temp-checkWatchersCount", + "method": "GET", + "headers": { + "Accept": { + "equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" + } + } + }, + "response": { + "status": 200, + "bodyFileName": "repos_github-api-test-org_temp-checkwatcherscount-480b7f68-9bb9-4443-b01f-d617b71fd015.json", + "headers": { + "Date": "Thu, 23 Jan 2020 19:15:51 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": "1579808711", + "Cache-Control": "private, max-age=60, s-maxage=60", + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept-Encoding", + "Accept-Encoding" + ], + "ETag": "W/\"0f221fe32212e39d2028da930db55d9f\"", + "Last-Modified": "Thu, 23 Jan 2020 19:15:50 GMT", + "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion", + "X-Accepted-OAuth-Scopes": "repo", + "X-GitHub-Media-Type": "unknown, github.v3", + "Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type", + "Access-Control-Allow-Origin": "*", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options": "deny", + "X-Content-Type-Options": "nosniff", + "X-XSS-Protection": "1; mode=block", + "Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy": "default-src 'none'", + "X-GitHub-Request-Id": "FDCA:20D3:4C9169:BDFFB4:5E29F0E1" + } + }, + "uuid": "480b7f68-9bb9-4443-b01f-d617b71fd015", + "persistent": true, + "insertionIndex": 2 +} \ No newline at end of file