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 9b16a1c

Browse filesBrowse files
add tests
1 parent 9a918e3 commit 9b16a1c
Copy full SHA for 9b16a1c

File tree

Expand file treeCollapse file tree

1 file changed

+26
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+26
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/GHTeamTest.java
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.kohsuke.github.GHTeam.Privacy;
55

66
import java.io.IOException;
7+
import java.util.List;
78
import java.util.Set;
89

910
import static org.junit.Assert.assertEquals;
@@ -34,6 +35,31 @@ public void testSetDescription() throws IOException {
3435
assertEquals(description, team.getDescription());
3536
}
3637

38+
@Test
39+
public void testlistMembersAdmin() throws IOException {
40+
String teamSlug = "dummy-team";
41+
42+
GHTeam team = gitHub.getOrganization(GITHUB_API_TEST_ORG).getTeamBySlug(teamSlug);
43+
44+
List<GHUser> admins = team.listMembers("admin").asList();
45+
46+
assertNotNull(admins);
47+
assertThat("One admin in dummy team", admins.size() == 1);
48+
assertThat("Specific user in admin team",
49+
admins.stream().anyMatch(ghUser -> ghUser.getLogin().equals("bitwiseman")));
50+
}
51+
52+
@Test
53+
public void testlistMembersNoMatch() throws IOException {
54+
String teamSlug = "dummy-team";
55+
56+
GHTeam team = gitHub.getOrganization(GITHUB_API_TEST_ORG).getTeamBySlug(teamSlug);
57+
58+
List<GHUser> justMembers = team.listMembers("member").asList();
59+
60+
assertThat("No regular members in team", justMembers.isEmpty());
61+
}
62+
3763
@Test
3864
public void testSetPrivacy() throws IOException {
3965
String teamSlug = "dummy-team";

0 commit comments

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