This repository was archived by the owner on Jul 31, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import org .kohsuke .github .GHOrganization ;
2+ import org .kohsuke .github .GHTeam ;
13import org .kohsuke .github .GitHub ;
24
35import java .util .Arrays ;
6+ import java .util .Map ;
47
58/**
69 * @author Kohsuke Kawaguchi
710 */
811public class Foo {
912 public static void main (String [] args ) throws Exception {
10- System .out .println (GitHub .connect ().getOrganization ("cloudbees" ).getRepository ("grandcentral" ).isPrivate ());
13+ GHOrganization org = GitHub .connect ().getOrganization ("jenkinsci" );
14+ Map <String , GHTeam > teams = org .getTeams ();
15+ System .out .println (teams .size ());
16+
17+ int sz = 0 ;
18+ for (GHTeam t : org .listTeams ()) {
19+ sz ++;
20+ }
21+ System .out .println (sz );
1122 }
1223}
Original file line number Diff line number Diff line change @@ -259,6 +259,16 @@ public void testMemberOrgs() throws Exception {
259259 System .out .println (o );
260260 }
261261
262+ @ Test
263+ public void testOrgTeams () throws Exception {
264+ int sz =0 ;
265+ for (GHTeam t : gitHub .getOrganization ("jenkinsci" ).listTeams ()) {
266+ assertNotNull (t .getName ());
267+ sz ++;
268+ }
269+ assertTrue (sz >1000 );
270+ }
271+
262272 @ Test
263273 public void testCommit () throws Exception {
264274 GHCommit commit = gitHub .getUser ("jenkinsci" ).getRepository ("jenkins" ).getCommit ("08c1c9970af4d609ae754fbe803e06186e3206f7" );
You can’t perform that action at this time.
0 commit comments