Skip to content

Commit 6d423f6

Browse files
committed
Add test
1 parent c74edbb commit 6d423f6

File tree

7 files changed

+501
-0
lines changed

7 files changed

+501
-0
lines changed

src/test/java/org/kohsuke/github/GHOrganizationTest.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,36 @@ public void testListMembersWithRole() throws IOException {
240240
"Sage-Pierce",
241241
"timja"));
242242
}
243+
244+
/**
245+
* Test list outside collaborators with filter.
246+
*
247+
* @throws IOException
248+
* Signals that an I/O exception has occurred.
249+
*/
250+
@Test
251+
public void testListOutsideCollaboratorsWithFilter() throws IOException {
252+
GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG);
253+
254+
List<GHUser> admins = org.listOutsideCollaboratorsWithFilter("all").toList();
255+
256+
assertThat(admins, notNullValue());
257+
// In case more are added in the future
258+
assertThat(admins.size(), greaterThanOrEqualTo(12));
259+
assertThat(admins.stream().map(GHUser::getLogin).collect(Collectors.toList()),
260+
hasItems("alexanderrtaylor",
261+
"asthinasthi",
262+
"bitwiseman",
263+
"farmdawgnation",
264+
"halkeye",
265+
"jberglund-BSFT",
266+
"kohsuke",
267+
"kohsuke2",
268+
"martinvanzijl",
269+
"PauloMigAlmeida",
270+
"Sage-Pierce",
271+
"timja"));
272+
}
243273

244274
/**
245275
* Test create team with repo access.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"login": "hub4j-test-org",
3+
"id": 7544739,
4+
"node_id": "MDEyOk9yZ2FuaXphdGlvbjc1NDQ3Mzk=",
5+
"url": "https://api.github.com/orgs/hub4j-test-org",
6+
"repos_url": "https://api.github.com/orgs/hub4j-test-org/repos",
7+
"events_url": "https://api.github.com/orgs/hub4j-test-org/events",
8+
"hooks_url": "https://api.github.com/orgs/hub4j-test-org/hooks",
9+
"issues_url": "https://api.github.com/orgs/hub4j-test-org/issues",
10+
"members_url": "https://api.github.com/orgs/hub4j-test-org/members{/member}",
11+
"public_members_url": "https://api.github.com/orgs/hub4j-test-org/public_members{/member}",
12+
"avatar_url": "https://avatars3.githubusercontent.com/u/7544739?v=4",
13+
"description": null,
14+
"is_verified": false,
15+
"has_organization_projects": true,
16+
"has_repository_projects": true,
17+
"public_repos": 11,
18+
"public_gists": 0,
19+
"followers": 0,
20+
"following": 0,
21+
"html_url": "https://github.com/hub4j-test-org",
22+
"created_at": "2014-05-10T19:39:11Z",
23+
"updated_at": "2015-04-20T00:42:30Z",
24+
"type": "Organization",
25+
"total_private_repos": 0,
26+
"owned_private_repos": 0,
27+
"private_gists": 0,
28+
"disk_usage": 147,
29+
"collaborators": 0,
30+
"billing_email": "kk@kohsuke.org",
31+
"default_repository_permission": "none",
32+
"members_can_create_repositories": false,
33+
"two_factor_requirement_enabled": false,
34+
"plan": {
35+
"name": "free",
36+
"space": 976562499,
37+
"private_repos": 0,
38+
"filled_seats": 12,
39+
"seats": 0
40+
}
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
[
2+
{
3+
"login": "alexanderrtaylor",
4+
"id": 852179,
5+
"node_id": "MDQ6VXNlcjg1MjE3OQ==",
6+
"avatar_url": "https://avatars0.githubusercontent.com/u/852179?v=4",
7+
"gravatar_id": "",
8+
"url": "https://api.github.com/users/alexanderrtaylor",
9+
"html_url": "https://github.com/alexanderrtaylor",
10+
"followers_url": "https://api.github.com/users/alexanderrtaylor/followers",
11+
"following_url": "https://api.github.com/users/alexanderrtaylor/following{/other_user}",
12+
"gists_url": "https://api.github.com/users/alexanderrtaylor/gists{/gist_id}",
13+
"starred_url": "https://api.github.com/users/alexanderrtaylor/starred{/owner}{/repo}",
14+
"subscriptions_url": "https://api.github.com/users/alexanderrtaylor/subscriptions",
15+
"organizations_url": "https://api.github.com/users/alexanderrtaylor/orgs",
16+
"repos_url": "https://api.github.com/users/alexanderrtaylor/repos",
17+
"events_url": "https://api.github.com/users/alexanderrtaylor/events{/privacy}",
18+
"received_events_url": "https://api.github.com/users/alexanderrtaylor/received_events",
19+
"type": "User",
20+
"site_admin": false
21+
},
22+
{
23+
"login": "asthinasthi",
24+
"id": 4577101,
25+
"node_id": "MDQ6VXNlcjQ1NzcxMDE=",
26+
"avatar_url": "https://avatars1.githubusercontent.com/u/4577101?v=4",
27+
"gravatar_id": "",
28+
"url": "https://api.github.com/users/asthinasthi",
29+
"html_url": "https://github.com/asthinasthi",
30+
"followers_url": "https://api.github.com/users/asthinasthi/followers",
31+
"following_url": "https://api.github.com/users/asthinasthi/following{/other_user}",
32+
"gists_url": "https://api.github.com/users/asthinasthi/gists{/gist_id}",
33+
"starred_url": "https://api.github.com/users/asthinasthi/starred{/owner}{/repo}",
34+
"subscriptions_url": "https://api.github.com/users/asthinasthi/subscriptions",
35+
"organizations_url": "https://api.github.com/users/asthinasthi/orgs",
36+
"repos_url": "https://api.github.com/users/asthinasthi/repos",
37+
"events_url": "https://api.github.com/users/asthinasthi/events{/privacy}",
38+
"received_events_url": "https://api.github.com/users/asthinasthi/received_events",
39+
"type": "User",
40+
"site_admin": false
41+
},
42+
{
43+
"login": "bitwiseman",
44+
"id": 1958953,
45+
"node_id": "MDQ6VXNlcjE5NTg5NTM=",
46+
"avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4",
47+
"gravatar_id": "",
48+
"url": "https://api.github.com/users/bitwiseman",
49+
"html_url": "https://github.com/bitwiseman",
50+
"followers_url": "https://api.github.com/users/bitwiseman/followers",
51+
"following_url": "https://api.github.com/users/bitwiseman/following{/other_user}",
52+
"gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}",
53+
"starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}",
54+
"subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions",
55+
"organizations_url": "https://api.github.com/users/bitwiseman/orgs",
56+
"repos_url": "https://api.github.com/users/bitwiseman/repos",
57+
"events_url": "https://api.github.com/users/bitwiseman/events{/privacy}",
58+
"received_events_url": "https://api.github.com/users/bitwiseman/received_events",
59+
"type": "User",
60+
"site_admin": false
61+
},
62+
{
63+
"login": "farmdawgnation",
64+
"id": 620189,
65+
"node_id": "MDQ6VXNlcjYyMDE4OQ==",
66+
"avatar_url": "https://avatars2.githubusercontent.com/u/620189?v=4",
67+
"gravatar_id": "",
68+
"url": "https://api.github.com/users/farmdawgnation",
69+
"html_url": "https://github.com/farmdawgnation",
70+
"followers_url": "https://api.github.com/users/farmdawgnation/followers",
71+
"following_url": "https://api.github.com/users/farmdawgnation/following{/other_user}",
72+
"gists_url": "https://api.github.com/users/farmdawgnation/gists{/gist_id}",
73+
"starred_url": "https://api.github.com/users/farmdawgnation/starred{/owner}{/repo}",
74+
"subscriptions_url": "https://api.github.com/users/farmdawgnation/subscriptions",
75+
"organizations_url": "https://api.github.com/users/farmdawgnation/orgs",
76+
"repos_url": "https://api.github.com/users/farmdawgnation/repos",
77+
"events_url": "https://api.github.com/users/farmdawgnation/events{/privacy}",
78+
"received_events_url": "https://api.github.com/users/farmdawgnation/received_events",
79+
"type": "User",
80+
"site_admin": false
81+
},
82+
{
83+
"login": "halkeye",
84+
"id": 110087,
85+
"node_id": "MDQ6VXNlcjExMDA4Nw==",
86+
"avatar_url": "https://avatars3.githubusercontent.com/u/110087?v=4",
87+
"gravatar_id": "",
88+
"url": "https://api.github.com/users/halkeye",
89+
"html_url": "https://github.com/halkeye",
90+
"followers_url": "https://api.github.com/users/halkeye/followers",
91+
"following_url": "https://api.github.com/users/halkeye/following{/other_user}",
92+
"gists_url": "https://api.github.com/users/halkeye/gists{/gist_id}",
93+
"starred_url": "https://api.github.com/users/halkeye/starred{/owner}{/repo}",
94+
"subscriptions_url": "https://api.github.com/users/halkeye/subscriptions",
95+
"organizations_url": "https://api.github.com/users/halkeye/orgs",
96+
"repos_url": "https://api.github.com/users/halkeye/repos",
97+
"events_url": "https://api.github.com/users/halkeye/events{/privacy}",
98+
"received_events_url": "https://api.github.com/users/halkeye/received_events",
99+
"type": "User",
100+
"site_admin": false
101+
},
102+
{
103+
"login": "jberglund-BSFT",
104+
"id": 19560713,
105+
"node_id": "MDQ6VXNlcjE5NTYwNzEz",
106+
"avatar_url": "https://avatars3.githubusercontent.com/u/19560713?v=4",
107+
"gravatar_id": "",
108+
"url": "https://api.github.com/users/jberglund-BSFT",
109+
"html_url": "https://github.com/jberglund-BSFT",
110+
"followers_url": "https://api.github.com/users/jberglund-BSFT/followers",
111+
"following_url": "https://api.github.com/users/jberglund-BSFT/following{/other_user}",
112+
"gists_url": "https://api.github.com/users/jberglund-BSFT/gists{/gist_id}",
113+
"starred_url": "https://api.github.com/users/jberglund-BSFT/starred{/owner}{/repo}",
114+
"subscriptions_url": "https://api.github.com/users/jberglund-BSFT/subscriptions",
115+
"organizations_url": "https://api.github.com/users/jberglund-BSFT/orgs",
116+
"repos_url": "https://api.github.com/users/jberglund-BSFT/repos",
117+
"events_url": "https://api.github.com/users/jberglund-BSFT/events{/privacy}",
118+
"received_events_url": "https://api.github.com/users/jberglund-BSFT/received_events",
119+
"type": "User",
120+
"site_admin": false
121+
},
122+
{
123+
"login": "kohsuke",
124+
"id": 50003,
125+
"node_id": "MDQ6VXNlcjUwMDAz",
126+
"avatar_url": "https://avatars1.githubusercontent.com/u/50003?v=4",
127+
"gravatar_id": "",
128+
"url": "https://api.github.com/users/kohsuke",
129+
"html_url": "https://github.com/kohsuke",
130+
"followers_url": "https://api.github.com/users/kohsuke/followers",
131+
"following_url": "https://api.github.com/users/kohsuke/following{/other_user}",
132+
"gists_url": "https://api.github.com/users/kohsuke/gists{/gist_id}",
133+
"starred_url": "https://api.github.com/users/kohsuke/starred{/owner}{/repo}",
134+
"subscriptions_url": "https://api.github.com/users/kohsuke/subscriptions",
135+
"organizations_url": "https://api.github.com/users/kohsuke/orgs",
136+
"repos_url": "https://api.github.com/users/kohsuke/repos",
137+
"events_url": "https://api.github.com/users/kohsuke/events{/privacy}",
138+
"received_events_url": "https://api.github.com/users/kohsuke/received_events",
139+
"type": "User",
140+
"site_admin": false
141+
},
142+
{
143+
"login": "kohsuke2",
144+
"id": 1329242,
145+
"node_id": "MDQ6VXNlcjEzMjkyNDI=",
146+
"avatar_url": "https://avatars2.githubusercontent.com/u/1329242?v=4",
147+
"gravatar_id": "",
148+
"url": "https://api.github.com/users/kohsuke2",
149+
"html_url": "https://github.com/kohsuke2",
150+
"followers_url": "https://api.github.com/users/kohsuke2/followers",
151+
"following_url": "https://api.github.com/users/kohsuke2/following{/other_user}",
152+
"gists_url": "https://api.github.com/users/kohsuke2/gists{/gist_id}",
153+
"starred_url": "https://api.github.com/users/kohsuke2/starred{/owner}{/repo}",
154+
"subscriptions_url": "https://api.github.com/users/kohsuke2/subscriptions",
155+
"organizations_url": "https://api.github.com/users/kohsuke2/orgs",
156+
"repos_url": "https://api.github.com/users/kohsuke2/repos",
157+
"events_url": "https://api.github.com/users/kohsuke2/events{/privacy}",
158+
"received_events_url": "https://api.github.com/users/kohsuke2/received_events",
159+
"type": "User",
160+
"site_admin": false
161+
},
162+
{
163+
"login": "martinvanzijl",
164+
"id": 24422213,
165+
"node_id": "MDQ6VXNlcjI0NDIyMjEz",
166+
"avatar_url": "https://avatars0.githubusercontent.com/u/24422213?v=4",
167+
"gravatar_id": "",
168+
"url": "https://api.github.com/users/martinvanzijl",
169+
"html_url": "https://github.com/martinvanzijl",
170+
"followers_url": "https://api.github.com/users/martinvanzijl/followers",
171+
"following_url": "https://api.github.com/users/martinvanzijl/following{/other_user}",
172+
"gists_url": "https://api.github.com/users/martinvanzijl/gists{/gist_id}",
173+
"starred_url": "https://api.github.com/users/martinvanzijl/starred{/owner}{/repo}",
174+
"subscriptions_url": "https://api.github.com/users/martinvanzijl/subscriptions",
175+
"organizations_url": "https://api.github.com/users/martinvanzijl/orgs",
176+
"repos_url": "https://api.github.com/users/martinvanzijl/repos",
177+
"events_url": "https://api.github.com/users/martinvanzijl/events{/privacy}",
178+
"received_events_url": "https://api.github.com/users/martinvanzijl/received_events",
179+
"type": "User",
180+
"site_admin": false
181+
},
182+
{
183+
"login": "PauloMigAlmeida",
184+
"id": 1011868,
185+
"node_id": "MDQ6VXNlcjEwMTE4Njg=",
186+
"avatar_url": "https://avatars1.githubusercontent.com/u/1011868?v=4",
187+
"gravatar_id": "",
188+
"url": "https://api.github.com/users/PauloMigAlmeida",
189+
"html_url": "https://github.com/PauloMigAlmeida",
190+
"followers_url": "https://api.github.com/users/PauloMigAlmeida/followers",
191+
"following_url": "https://api.github.com/users/PauloMigAlmeida/following{/other_user}",
192+
"gists_url": "https://api.github.com/users/PauloMigAlmeida/gists{/gist_id}",
193+
"starred_url": "https://api.github.com/users/PauloMigAlmeida/starred{/owner}{/repo}",
194+
"subscriptions_url": "https://api.github.com/users/PauloMigAlmeida/subscriptions",
195+
"organizations_url": "https://api.github.com/users/PauloMigAlmeida/orgs",
196+
"repos_url": "https://api.github.com/users/PauloMigAlmeida/repos",
197+
"events_url": "https://api.github.com/users/PauloMigAlmeida/events{/privacy}",
198+
"received_events_url": "https://api.github.com/users/PauloMigAlmeida/received_events",
199+
"type": "User",
200+
"site_admin": false
201+
},
202+
{
203+
"login": "Sage-Pierce",
204+
"id": 5396306,
205+
"node_id": "MDQ6VXNlcjUzOTYzMDY=",
206+
"avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4",
207+
"gravatar_id": "",
208+
"url": "https://api.github.com/users/Sage-Pierce",
209+
"html_url": "https://github.com/Sage-Pierce",
210+
"followers_url": "https://api.github.com/users/Sage-Pierce/followers",
211+
"following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}",
212+
"gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}",
213+
"starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}",
214+
"subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions",
215+
"organizations_url": "https://api.github.com/users/Sage-Pierce/orgs",
216+
"repos_url": "https://api.github.com/users/Sage-Pierce/repos",
217+
"events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}",
218+
"received_events_url": "https://api.github.com/users/Sage-Pierce/received_events",
219+
"type": "User",
220+
"site_admin": false
221+
},
222+
{
223+
"login": "timja",
224+
"id": 21194782,
225+
"node_id": "MDQ6VXNlcjIxMTk0Nzgy",
226+
"avatar_url": "https://avatars3.githubusercontent.com/u/21194782?v=4",
227+
"gravatar_id": "",
228+
"url": "https://api.github.com/users/timja",
229+
"html_url": "https://github.com/timja",
230+
"followers_url": "https://api.github.com/users/timja/followers",
231+
"following_url": "https://api.github.com/users/timja/following{/other_user}",
232+
"gists_url": "https://api.github.com/users/timja/gists{/gist_id}",
233+
"starred_url": "https://api.github.com/users/timja/starred{/owner}{/repo}",
234+
"subscriptions_url": "https://api.github.com/users/timja/subscriptions",
235+
"organizations_url": "https://api.github.com/users/timja/orgs",
236+
"repos_url": "https://api.github.com/users/timja/repos",
237+
"events_url": "https://api.github.com/users/timja/events{/privacy}",
238+
"received_events_url": "https://api.github.com/users/timja/received_events",
239+
"type": "User",
240+
"site_admin": false
241+
}
242+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"login": "Sage-Pierce",
3+
"id": 5396306,
4+
"node_id": "MDQ6VXNlcjUzOTYzMDY=",
5+
"avatar_url": "https://avatars3.githubusercontent.com/u/5396306?v=4",
6+
"gravatar_id": "",
7+
"url": "https://api.github.com/users/Sage-Pierce",
8+
"html_url": "https://github.com/Sage-Pierce",
9+
"followers_url": "https://api.github.com/users/Sage-Pierce/followers",
10+
"following_url": "https://api.github.com/users/Sage-Pierce/following{/other_user}",
11+
"gists_url": "https://api.github.com/users/Sage-Pierce/gists{/gist_id}",
12+
"starred_url": "https://api.github.com/users/Sage-Pierce/starred{/owner}{/repo}",
13+
"subscriptions_url": "https://api.github.com/users/Sage-Pierce/subscriptions",
14+
"organizations_url": "https://api.github.com/users/Sage-Pierce/orgs",
15+
"repos_url": "https://api.github.com/users/Sage-Pierce/repos",
16+
"events_url": "https://api.github.com/users/Sage-Pierce/events{/privacy}",
17+
"received_events_url": "https://api.github.com/users/Sage-Pierce/received_events",
18+
"type": "User",
19+
"site_admin": false,
20+
"name": "Sage Pierce",
21+
"company": "@Vrbo @ExpediaGroup",
22+
"blog": "",
23+
"location": null,
24+
"email": "sapierce@vrbo.com",
25+
"hireable": true,
26+
"bio": "Software engineer with a Masters of Science in Electrical and Computer Engineering out of The University of Texas at Austin.",
27+
"public_repos": 9,
28+
"public_gists": 0,
29+
"followers": 4,
30+
"following": 0,
31+
"created_at": "2013-09-06T02:22:48Z",
32+
"updated_at": "2020-02-18T13:29:56Z",
33+
"private_gists": 0,
34+
"total_private_repos": 0,
35+
"owned_private_repos": 0,
36+
"disk_usage": 1816,
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+
}

0 commit comments

Comments
 (0)