File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Filter options
src/test/java/org/kohsuke/github Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Original file line number Diff line number Diff line change 4
4
import org .kohsuke .github .GHTeam .Privacy ;
5
5
6
6
import java .io .IOException ;
7
+ import java .util .List ;
7
8
import java .util .Set ;
8
9
9
10
import static org .junit .Assert .assertEquals ;
@@ -34,6 +35,31 @@ public void testSetDescription() throws IOException {
34
35
assertEquals (description , team .getDescription ());
35
36
}
36
37
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
+
37
63
@ Test
38
64
public void testSetPrivacy () throws IOException {
39
65
String teamSlug = "dummy-team" ;
You can’t perform that action at this time.
0 commit comments