diff --git a/src/main/java/org/kohsuke/github/GHTeam.java b/src/main/java/org/kohsuke/github/GHTeam.java index fea1cbdc91..db27a326ed 100644 --- a/src/main/java/org/kohsuke/github/GHTeam.java +++ b/src/main/java/org/kohsuke/github/GHTeam.java @@ -177,16 +177,14 @@ public PagedIterable 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 listChildTeams(GHOrganization organization) throws IOException { + public PagedIterable listChildTeams() throws IOException { return root.createRequest() .withUrlPath(api("/teams")) - .toIterable(GHTeam[].class, item -> item.wrapUp(organization)); + .toIterable(GHTeam[].class, item -> item.wrapUp(this.organization)); } /** @@ -203,14 +201,12 @@ public Set 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 getChildTeams(GHOrganization organization) throws IOException { - return listChildTeams(organization).toSet(); + public Set getChildTeams() throws IOException { + return listChildTeams().toSet(); } /** diff --git a/src/test/java/org/kohsuke/github/GHTeamTest.java b/src/test/java/org/kohsuke/github/GHTeamTest.java index b2272a5a9f..6d3cd0ac6c 100644 --- a/src/test/java/org/kohsuke/github/GHTeamTest.java +++ b/src/test/java/org/kohsuke/github/GHTeamTest.java @@ -63,7 +63,7 @@ public void testFetchChildTeams() throws IOException { GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); GHTeam team = org.getTeamBySlug(teamSlug); - Set result = team.getChildTeams(org); + Set result = team.getChildTeams(); assertEquals(1, result.size()); assertEquals("child-team-for-dummy", result.toArray(new GHTeam[]{})[0].getName());