Skip to content

Commit

Permalink
use this.organization instead of providing the organization as a para…
Browse files Browse the repository at this point in the history
…meter
  • Loading branch information
Alexander Kjäll committed Jun 24, 2020
1 parent 038dd20 commit 51319c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions src/main/java/org/kohsuke/github/GHTeam.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,14 @@ public PagedIterable<GHUser> listMembers() throws IOException {
/**
* Retrieves the teams that are members of this team.
*
* @param organization
* the organization that owns this team
* @return the paged iterable
* @throws IOException
* the io exception
*/
public PagedIterable<GHTeam> listChildTeams(GHOrganization organization) throws IOException {
public PagedIterable<GHTeam> listChildTeams() throws IOException {
return root.createRequest()
.withUrlPath(api("/teams"))
.toIterable(GHTeam[].class, item -> item.wrapUp(organization));
.toIterable(GHTeam[].class, item -> item.wrapUp(this.organization));
}

/**
Expand All @@ -203,14 +201,12 @@ public Set<GHUser> getMembers() throws IOException {
/**
* Gets the teams that are members of this team.
*
* @param organization
* the organization that owns this team
* @return the members
* @throws IOException
* the io exception
*/
public Set<GHTeam> getChildTeams(GHOrganization organization) throws IOException {
return listChildTeams(organization).toSet();
public Set<GHTeam> getChildTeams() throws IOException {
return listChildTeams().toSet();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/kohsuke/github/GHTeamTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testFetchChildTeams() throws IOException {

GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG);
GHTeam team = org.getTeamBySlug(teamSlug);
Set<GHTeam> result = team.getChildTeams(org);
Set<GHTeam> result = team.getChildTeams();

assertEquals(1, result.size());
assertEquals("child-team-for-dummy", result.toArray(new GHTeam[]{})[0].getName());
Expand Down

0 comments on commit 51319c3

Please sign in to comment.