Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit aaf10aa

Browse files
committed
added a test
1 parent 145bdac commit aaf10aa

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

src/test/java/Foo.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1+
import org.kohsuke.github.GHOrganization;
2+
import org.kohsuke.github.GHTeam;
13
import org.kohsuke.github.GitHub;
24

35
import java.util.Arrays;
6+
import java.util.Map;
47

58
/**
69
* @author Kohsuke Kawaguchi
710
*/
811
public 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
}

src/test/java/org/kohsuke/AppTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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");

0 commit comments

Comments
 (0)