Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cffee4e

Browse filesBrowse files
committed
Update tests
1 parent ec1fd1d commit cffee4e
Copy full SHA for cffee4e

File tree

Expand file treeCollapse file tree

11 files changed

+1133
-3
lines changed
Filter options
Expand file treeCollapse file tree

11 files changed

+1133
-3
lines changed

‎src/test/java/org/kohsuke/github/GHRepositoryTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/GHRepositoryTest.java
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import static org.hamcrest.Matchers.*;
2323
import static org.hamcrest.core.IsInstanceOf.instanceOf;
24+
import static org.junit.Assert.assertEquals;
2425
import static org.junit.Assert.assertThrows;
2526
import static org.kohsuke.github.GHVerification.Reason.GPGVERIFY_ERROR;
2627
import static org.kohsuke.github.GHVerification.Reason.UNKNOWN_SIGNATURE_TYPE;
@@ -520,17 +521,18 @@ public void listContributorsAnon() throws IOException {
520521
boolean kohsuke = false;
521522

522523
for (GHRepository.Contributor c : r.listContributors(true)) {
523-
if (c.getLogin().equals("kohsuke")) {
524-
assertThat(c.getContributions(), greaterThan(0));
524+
if (c.getType().equals("Anonymous")) {
525+
assertEquals(c.getContributions(), 3);
525526
kohsuke = true;
526527
}
527-
if (i++ > 5) {
528+
if (++i > 1) {
528529
break;
529530
}
530531
}
531532

532533
assertThat(kohsuke, is(true));
533534
}
535+
534536
/**
535537
* Gets the permission.
536538
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"login": "bitwiseman",
3+
"id": 1958953,
4+
"node_id": "MDQ6VXNlcjE5NTg5NTM=",
5+
"avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4",
6+
"gravatar_id": "",
7+
"url": "https://api.github.com/users/bitwiseman",
8+
"html_url": "https://github.com/bitwiseman",
9+
"followers_url": "https://api.github.com/users/bitwiseman/followers",
10+
"following_url": "https://api.github.com/users/bitwiseman/following{/other_user}",
11+
"gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}",
12+
"starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}",
13+
"subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions",
14+
"organizations_url": "https://api.github.com/users/bitwiseman/orgs",
15+
"repos_url": "https://api.github.com/users/bitwiseman/repos",
16+
"events_url": "https://api.github.com/users/bitwiseman/events{/privacy}",
17+
"received_events_url": "https://api.github.com/users/bitwiseman/received_events",
18+
"type": "User",
19+
"site_admin": false,
20+
"name": "Liam Newman",
21+
"company": "Cloudbees, Inc.",
22+
"blog": "",
23+
"location": "Seattle, WA, USA",
24+
"email": "bitwiseman@gmail.com",
25+
"hireable": null,
26+
"bio": "https://twitter.com/bitwiseman",
27+
"public_repos": 167,
28+
"public_gists": 4,
29+
"followers": 136,
30+
"following": 9,
31+
"created_at": "2012-07-11T20:38:33Z",
32+
"updated_at": "2019-09-24T19:32:29Z",
33+
"private_gists": 7,
34+
"total_private_repos": 9,
35+
"owned_private_repos": 0,
36+
"disk_usage": 33697,
37+
"collaborators": 0,
38+
"two_factor_authentication": true,
39+
"plan": {
40+
"name": "free",
41+
"space": 976562499,
42+
"collaborators": 0,
43+
"private_repos": 10000
44+
}
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"login": "kohsuke",
3+
"id": 50003,
4+
"node_id": "MDQ6VXNlcjUwMDAz",
5+
"avatar_url": "https://avatars.githubusercontent.com/u/50003?v=4",
6+
"gravatar_id": "",
7+
"url": "https://api.github.com/users/kohsuke",
8+
"html_url": "https://github.com/kohsuke",
9+
"followers_url": "https://api.github.com/users/kohsuke/followers",
10+
"following_url": "https://api.github.com/users/kohsuke/following{/other_user}",
11+
"gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}",
12+
"starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}",
13+
"subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions",
14+
"organizations_url": "https://api.github.com/users/kohsuke/orgs",
15+
"repos_url": "https://api.github.com/users/kohsuke/repos",
16+
"events_url": "https://api.github.com/users/kohsuke/events{/privacy}",
17+
"received_events_url": "https://api.github.com/users/kohsuke/received_events",
18+
"type": "User",
19+
"site_admin": false,
20+
"name": "Kohsuke Kawaguchi",
21+
"company": "@launchableinc ",
22+
"blog": "https://www.kohsuke.org/",
23+
"location": "San Jose, California",
24+
"email": "kk@kohsuke.org",
25+
"hireable": null,
26+
"bio": null,
27+
"twitter_username": null,
28+
"public_repos": 265,
29+
"public_gists": 113,
30+
"followers": 1999,
31+
"following": 3,
32+
"created_at": "2009-01-28T18:53:21Z",
33+
"updated_at": "2022-04-10T22:58:15Z"
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"login": "hub4j",
3+
"id": 54909825,
4+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1",
5+
"url": "https://api.github.com/orgs/hub4j",
6+
"repos_url": "https://api.github.com/orgs/hub4j/repos",
7+
"events_url": "https://api.github.com/orgs/hub4j/events",
8+
"hooks_url": "https://api.github.com/orgs/hub4j/hooks",
9+
"issues_url": "https://api.github.com/orgs/hub4j/issues",
10+
"members_url": "https://api.github.com/orgs/hub4j/members{/member}",
11+
"public_members_url": "https://api.github.com/orgs/hub4j/public_members{/member}",
12+
"avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4",
13+
"description": null,
14+
"is_verified": false,
15+
"has_organization_projects": true,
16+
"has_repository_projects": true,
17+
"public_repos": 1,
18+
"public_gists": 0,
19+
"followers": 0,
20+
"following": 0,
21+
"html_url": "https://github.com/hub4j",
22+
"created_at": "2019-09-04T18:12:34Z",
23+
"updated_at": "2019-09-04T18:12:34Z",
24+
"type": "Organization",
25+
"total_private_repos": 0,
26+
"owned_private_repos": 0,
27+
"private_gists": 0,
28+
"disk_usage": 11899,
29+
"collaborators": 0,
30+
"billing_email": "bitwiseman@gmail.com",
31+
"default_repository_permission": "read",
32+
"members_can_create_repositories": true,
33+
"two_factor_requirement_enabled": false,
34+
"plan": {
35+
"name": "free",
36+
"space": 976562499,
37+
"private_repos": 0,
38+
"filled_seats": 2,
39+
"seats": 0
40+
}
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"id": 617210,
3+
"node_id": "MDEwOlJlcG9zaXRvcnk2MTcyMTA=",
4+
"name": "github-api",
5+
"full_name": "hub4j/github-api",
6+
"private": false,
7+
"owner": {
8+
"login": "hub4j",
9+
"id": 54909825,
10+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1",
11+
"avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4",
12+
"gravatar_id": "",
13+
"url": "https://api.github.com/users/hub4j",
14+
"html_url": "https://github.com/hub4j",
15+
"followers_url": "https://api.github.com/users/hub4j/followers",
16+
"following_url": "https://api.github.com/users/hub4j/following{/other_user}",
17+
"gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}",
18+
"starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}",
19+
"subscriptions_url": "https://api.github.com/users/hub4j/subscriptions",
20+
"organizations_url": "https://api.github.com/users/hub4j/orgs",
21+
"repos_url": "https://api.github.com/users/hub4j/repos",
22+
"events_url": "https://api.github.com/users/hub4j/events{/privacy}",
23+
"received_events_url": "https://api.github.com/users/hub4j/received_events",
24+
"type": "Organization",
25+
"site_admin": false
26+
},
27+
"html_url": "https://github.com/hub4j/github-api",
28+
"description": "Java API for GitHub",
29+
"fork": false,
30+
"url": "https://api.github.com/repos/hub4j/github-api",
31+
"forks_url": "https://api.github.com/repos/hub4j/github-api/forks",
32+
"keys_url": "https://api.github.com/repos/hub4j/github-api/keys{/key_id}",
33+
"collaborators_url": "https://api.github.com/repos/hub4j/github-api/collaborators{/collaborator}",
34+
"teams_url": "https://api.github.com/repos/hub4j/github-api/teams",
35+
"hooks_url": "https://api.github.com/repos/hub4j/github-api/hooks",
36+
"issue_events_url": "https://api.github.com/repos/hub4j/github-api/issues/events{/number}",
37+
"events_url": "https://api.github.com/repos/hub4j/github-api/events",
38+
"assignees_url": "https://api.github.com/repos/hub4j/github-api/assignees{/user}",
39+
"branches_url": "https://api.github.com/repos/hub4j/github-api/branches{/branch}",
40+
"tags_url": "https://api.github.com/repos/hub4j/github-api/tags",
41+
"blobs_url": "https://api.github.com/repos/hub4j/github-api/git/blobs{/sha}",
42+
"git_tags_url": "https://api.github.com/repos/hub4j/github-api/git/tags{/sha}",
43+
"git_refs_url": "https://api.github.com/repos/hub4j/github-api/git/refs{/sha}",
44+
"trees_url": "https://api.github.com/repos/hub4j/github-api/git/trees{/sha}",
45+
"statuses_url": "https://api.github.com/repos/hub4j/github-api/statuses/{sha}",
46+
"languages_url": "https://api.github.com/repos/hub4j/github-api/languages",
47+
"stargazers_url": "https://api.github.com/repos/hub4j/github-api/stargazers",
48+
"contributors_url": "https://api.github.com/repos/hub4j/github-api/contributors?anon=true",
49+
"subscribers_url": "https://api.github.com/repos/hub4j/github-api/subscribers",
50+
"subscription_url": "https://api.github.com/repos/hub4j/github-api/subscription",
51+
"commits_url": "https://api.github.com/repos/hub4j/github-api/commits{/sha}",
52+
"git_commits_url": "https://api.github.com/repos/hub4j/github-api/git/commits{/sha}",
53+
"comments_url": "https://api.github.com/repos/hub4j/github-api/comments{/number}",
54+
"issue_comment_url": "https://api.github.com/repos/hub4j/github-api/issues/comments{/number}",
55+
"contents_url": "https://api.github.com/repos/hub4j/github-api/contents/{+path}",
56+
"compare_url": "https://api.github.com/repos/hub4j/github-api/compare/{base}...{head}",
57+
"merges_url": "https://api.github.com/repos/hub4j/github-api/merges",
58+
"archive_url": "https://api.github.com/repos/hub4j/github-api/{archive_format}{/ref}",
59+
"downloads_url": "https://api.github.com/repos/hub4j/github-api/downloads",
60+
"issues_url": "https://api.github.com/repos/hub4j/github-api/issues{/number}",
61+
"pulls_url": "https://api.github.com/repos/hub4j/github-api/pulls{/number}",
62+
"milestones_url": "https://api.github.com/repos/hub4j/github-api/milestones{/number}",
63+
"notifications_url": "https://api.github.com/repos/hub4j/github-api/notifications{?since,all,participating}",
64+
"labels_url": "https://api.github.com/repos/hub4j/github-api/labels{/name}",
65+
"releases_url": "https://api.github.com/repos/hub4j/github-api/releases{/id}",
66+
"deployments_url": "https://api.github.com/repos/hub4j/github-api/deployments",
67+
"created_at": "2010-04-19T04:13:03Z",
68+
"updated_at": "2019-10-03T09:41:10Z",
69+
"pushed_at": "2019-10-02T22:27:45Z",
70+
"git_url": "git://github.com/hub4j/github-api.git",
71+
"ssh_url": "git@github.com:hub4j/github-api.git",
72+
"clone_url": "https://github.com/hub4j/github-api.git",
73+
"svn_url": "https://github.com/hub4j/github-api",
74+
"homepage": "http://github-api.kohsuke.org/",
75+
"size": 11899,
76+
"stargazers_count": 557,
77+
"watchers_count": 557,
78+
"language": "Java",
79+
"has_issues": true,
80+
"has_projects": true,
81+
"has_downloads": true,
82+
"has_wiki": true,
83+
"has_pages": true,
84+
"forks_count": 428,
85+
"mirror_url": null,
86+
"archived": false,
87+
"disabled": false,
88+
"open_issues_count": 90,
89+
"license": {
90+
"key": "mit",
91+
"name": "MIT License",
92+
"spdx_id": "MIT",
93+
"url": "https://api.github.com/licenses/mit",
94+
"node_id": "MDc6TGljZW5zZTEz"
95+
},
96+
"forks": 428,
97+
"open_issues": 90,
98+
"watchers": 557,
99+
"default_branch": "main",
100+
"permissions": {
101+
"admin": true,
102+
"push": true,
103+
"pull": true
104+
},
105+
"allow_squash_merge": true,
106+
"allow_merge_commit": true,
107+
"allow_rebase_merge": true,
108+
"organization": {
109+
"login": "hub4j",
110+
"id": 54909825,
111+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0OTA5ODI1",
112+
"avatar_url": "https://avatars3.githubusercontent.com/u/54909825?v=4",
113+
"gravatar_id": "",
114+
"url": "https://api.github.com/users/hub4j",
115+
"html_url": "https://github.com/hub4j",
116+
"followers_url": "https://api.github.com/users/hub4j/followers",
117+
"following_url": "https://api.github.com/users/hub4j/following{/other_user}",
118+
"gists_url": "https://api.github.com/users/hub4j/gists{/gist_id}",
119+
"starred_url": "https://api.github.com/users/hub4j/starred{/owner}{/repo}",
120+
"subscriptions_url": "https://api.github.com/users/hub4j/subscriptions",
121+
"organizations_url": "https://api.github.com/users/hub4j/orgs",
122+
"repos_url": "https://api.github.com/users/hub4j/repos",
123+
"events_url": "https://api.github.com/users/hub4j/events{/privacy}",
124+
"received_events_url": "https://api.github.com/users/hub4j/received_events",
125+
"type": "Organization",
126+
"site_admin": false
127+
},
128+
"network_count": 428,
129+
"subscribers_count": 50
130+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.