private ObjectMapper mapper = new ObjectMapper();
@Before
public void setUp() throws Exception {
RestOperations restOperations = mock(RestOperations.class);
given(gitHub.restOperations()).willReturn(restOperations);
String membersJson = Fixtures.load("/fixtures/github/ghTeamInfo.json");
GitHubUser[] gitHubUsers = mapper.readValue(membersJson, GitHubUser[].class);
ResponseEntity<GitHubUser[]> responseEntity = new ResponseEntity<>(gitHubUsers, HttpStatus.OK);
given(
restOperations.getForEntity("https://api.github.com/teams/{teamId}/members", GitHubUser[].class,
"482984")).willReturn(responseEntity);
stubRestClient.putResponse("/users/jdoe", Fixtures.load("/fixtures/github/ghUserProfile-jdoe.json"));
stubRestClient.putResponse("/users/asmith", Fixtures.load("/fixtures/github/ghUserProfile-asmith.json"));
}