public Set<GsonProjectMember> getAllProjectMembers(String gitlabUrl, String token, long projectId) {
    String url = format("/projects/%s/members/all", projectId);
    return Set.copyOf(executePaginatedQuery(gitlabUrl, token, url, resp -> GSON.fromJson(resp, GITLAB_PROJECT_MEMBER)));
  }
@Test
  public void getAllProjectMembers_whenCallIsSuccesfull_deserializesAndReturnsCorrectlyProjectsMembers() throws IOException {
    ArgumentCaptor<Function<String, List<GsonProjectMember>>> deserializerCaptor = ArgumentCaptor.forClass(Function.class);

    String token = "token-toto";
    GitlabToken gitlabToken = new GitlabToken(token);
    List<GsonProjectMember> expectedProjectMembers = expectedProjectMembers();
    when(gitlabPaginatedHttpClient.get(eq(gitlabUrl), eq(gitlabToken), eq("/projects/42/members/all"), deserializerCaptor.capture())).thenReturn(expectedProjectMembers);

    Set<GsonProjectMember> actualProjectMembers = underTest.getAllProjectMembers(gitlabUrl, token, 42);
    assertThat(actualProjectMembers).containsExactlyInAnyOrderElementsOf(expectedProjectMembers);

    String responseContent = getResponseContent("project-members-full-response.json");

    List<GsonProjectMember> deserializedProjectMembers = deserializerCaptor.getValue().apply(responseContent);
    assertThat(deserializedProjectMembers).isEqualTo(expectedProjectMembers);

  }