@Test public void listTeams() throws Exception { mockServer.expect(requestTo("https: .andExpect(method(HttpMethod.GET)) .andRespond( withSuccess(new ClassPathResource("listTeams.json", getClass()), MediaType.APPLICATION_JSON)); List<Team> teamList = teamsTemplate.listTeams("zalando-stups"); Assertions.assertThat(teamList).isNotNull(); Assertions.assertThat(teamList.size()).isEqualTo(1); }
@Override public List<Team> listTeams(String organization) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); List<Team> teamList = new ArrayList<Team>(); Iterator<List<Team>> iter = new PagingIterator<>(getRestOperations(), buildUri("/orgs/{organization}/teams?per_page=25", uriVariables), teamListTypeRef); while (iter.hasNext()) { teamList.addAll(iter.next()); } return teamList; }
TeamsTemplate extends AbstractGithubTemplate implements TeamsOperations { @Override public List<Team> listTeams(String organization) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); List<Team> teamList = new ArrayList<Team>(); Iterator<List<Team>> iter = new PagingIterator<>(getRestOperations(), buildUri("/orgs/{organization}/teams?per_page=25", uriVariables), teamListTypeRef); while (iter.hasNext()) { teamList.addAll(iter.next()); } return teamList; } }
TeamsTemplate extends AbstractGithubTemplate implements TeamsOperations { @Override public List<Team> listTeams(String organization) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); List<Team> teamList = new ArrayList<Team>(); Iterator<List<Team>> iter = new PagingIterator<>(getRestOperations(), buildUri("/orgs/{organization}/teams?per_page=25", uriVariables), teamListTypeRef); while (iter.hasNext()) { teamList.addAll(iter.next()); } return teamList; } TeamsTemplate(RestOperations restOperations, GithubApiUriUtil uriUtil);  TeamsTemplate(RestOperations restOperations); }
TeamsTemplate extends AbstractGithubTemplate implements TeamsOperations { @Override public List<Team> listTeams(String organization) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); List<Team> teamList = new ArrayList<Team>(); Iterator<List<Team>> iter = new PagingIterator<>(getRestOperations(), buildUri("/orgs/{organization}/teams?per_page=25", uriVariables), teamListTypeRef); while (iter.hasNext()) { teamList.addAll(iter.next()); } return teamList; } TeamsTemplate(RestOperations restOperations, GithubApiUriUtil uriUtil);  TeamsTemplate(RestOperations restOperations); @Override List<Team> listTeams(String organization); @Override Team getTeam(long teamId); @Override Team createTeam(String organization, TeamRequest teamRequest); @Override Team updateTeam(long teamId, TeamRequest teamRequest); @Override void deleteTeam(long teamId); }
TeamsTemplate extends AbstractGithubTemplate implements TeamsOperations { @Override public List<Team> listTeams(String organization) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); List<Team> teamList = new ArrayList<Team>(); Iterator<List<Team>> iter = new PagingIterator<>(getRestOperations(), buildUri("/orgs/{organization}/teams?per_page=25", uriVariables), teamListTypeRef); while (iter.hasNext()) { teamList.addAll(iter.next()); } return teamList; } TeamsTemplate(RestOperations restOperations, GithubApiUriUtil uriUtil);  TeamsTemplate(RestOperations restOperations); @Override List<Team> listTeams(String organization); @Override Team getTeam(long teamId); @Override Team createTeam(String organization, TeamRequest teamRequest); @Override Team updateTeam(long teamId, TeamRequest teamRequest); @Override void deleteTeam(long teamId);  }