@Test public void createTeam() throws Exception { mockServer.expect(requestTo("https: .andExpect(method(HttpMethod.POST)).andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andRespond(withSuccess(new ClassPathResource("getTeam.json", getClass()), MediaType.APPLICATION_JSON)); Team team = teamsTemplate.createTeam("zalando-stups", new TeamRequest("Justice League")); Assertions.assertThat(team).isNotNull(); Assertions.assertThat(team.getId()).isEqualTo(1); Assertions.assertThat(team.getName()).isEqualTo("Justice League"); }
@Override public Team createTeam(String organization, TeamRequest teamRequest) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); RequestEntity<TeamRequest> entity = RequestEntity.post(buildUri("/orgs/{organization}/teams", uriVariables)) .contentType(MediaType.APPLICATION_JSON).body(teamRequest); return getRestOperations().exchange(entity, Team.class).getBody(); }
TeamsTemplate extends AbstractGithubTemplate implements TeamsOperations { @Override public Team createTeam(String organization, TeamRequest teamRequest) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); RequestEntity<TeamRequest> entity = RequestEntity.post(buildUri("/orgs/{organization}/teams", uriVariables)) .contentType(MediaType.APPLICATION_JSON).body(teamRequest); return getRestOperations().exchange(entity, Team.class).getBody(); } }
TeamsTemplate extends AbstractGithubTemplate implements TeamsOperations { @Override public Team createTeam(String organization, TeamRequest teamRequest) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); RequestEntity<TeamRequest> entity = RequestEntity.post(buildUri("/orgs/{organization}/teams", uriVariables)) .contentType(MediaType.APPLICATION_JSON).body(teamRequest); return getRestOperations().exchange(entity, Team.class).getBody(); } TeamsTemplate(RestOperations restOperations, GithubApiUriUtil uriUtil);  TeamsTemplate(RestOperations restOperations); }
TeamsTemplate extends AbstractGithubTemplate implements TeamsOperations { @Override public Team createTeam(String organization, TeamRequest teamRequest) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); RequestEntity<TeamRequest> entity = RequestEntity.post(buildUri("/orgs/{organization}/teams", uriVariables)) .contentType(MediaType.APPLICATION_JSON).body(teamRequest); return getRestOperations().exchange(entity, Team.class).getBody(); } 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 Team createTeam(String organization, TeamRequest teamRequest) { Map<String, Object> uriVariables = new HashMap<>(); uriVariables.put("organization", organization); RequestEntity<TeamRequest> entity = RequestEntity.post(buildUri("/orgs/{organization}/teams", uriVariables)) .contentType(MediaType.APPLICATION_JSON).body(teamRequest); return getRestOperations().exchange(entity, Team.class).getBody(); } 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);  }