public Set<GsonGroup> getGroups(String gitlabUrl, String token) {
    return Set.copyOf(executePaginatedQuery(gitlabUrl, token, "/groups", resp -> GSON.fromJson(resp, GITLAB_GROUP)));
  }
@Test
  public void getGroups_whenCallIsInError_rethrows() throws IOException {
    String token = "token-toto";
    GitlabToken gitlabToken = new GitlabToken(token);
    when(gitlabPaginatedHttpClient.get(eq(gitlabUrl), eq(gitlabToken), eq("/groups"), any())).thenThrow(new IllegalStateException("exception"));

    assertThatIllegalStateException()
      .isThrownBy(() -> underTest.getGroups(gitlabUrl, token))
      .withMessage("exception");
  }