Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/test/java/org/kohsuke/github/GHRepositoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,4 +424,20 @@ public void listTags() throws Exception {
assertThat(refs, notNullValue());
assertThat(refs.size(), greaterThan(90));
}

@Test
public void checkWatchersCount() throws Exception {
snapshotNotAllowed();
GHRepository repo = getTempRepository();
int watchersCount = repo.getWatchers();
assertEquals(10, watchersCount);
}

@Test
public void checkStargazersCount() throws Exception {
snapshotNotAllowed();
GHRepository repo = getTempRepository();
int stargazersCount = repo.getStargazersCount();
assertEquals(10, stargazersCount);
}
}
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"id": "bd22f750-1a7c-4274-b5d6-9e2164a1eb2a",
"name": "repos_github-api-test-org_temp-checkstargazerscount",
"request": {
"url": "/repos/github-api-test-org/temp-checkStargazersCount",
"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-checkstargazerscount-bd22f750-1a7c-4274-b5d6-9e2164a1eb2a.json",
"headers": {
"Server": "GitHub.com",
"Date": "Thu, 23 Jan 2020 19:16:21 GMT",
"Content-Type": "application/json; charset=utf-8",
"Status": "200 OK",
"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": "*",
"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": "FDD6:6F1D:4BF06C:BD9B80:5E29F0FF"
}
},
"uuid": "bd22f750-1a7c-4274-b5d6-9e2164a1eb2a",
"persistent": true,
"insertionIndex": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"id": "ebb96197-f82b-4a05-87e8-932107fd594e",
"name": "user",
"request": {
"url": "/user",
"method": "GET",
"headers": {
"Accept": {
"equalTo": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
}
}
},
"response": {
"status": 200,
"bodyFileName": "user-ebb96197-f82b-4a05-87e8-932107fd594e.json",
"headers": {
"Server": "GitHub.com",
"Date": "Thu, 23 Jan 2020 19:16:15 GMT",
"Content-Type": "application/json; charset=utf-8",
"Status": "200 OK",
"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": "*",
"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": "FDD6:6F1D:4BEF7C:BD9B79:5E29F0FF"
}
},
"uuid": "ebb96197-f82b-4a05-87e8-932107fd594e",
"persistent": true,
"insertionIndex": 1
}
Loading