public void addPermissionMapping(AddGithubPermissionMappingRequest addGithubPermissionMappingRequest) {
    callEndpoint(addGithubPermissionMappingRequest).close();
  }
@Test
  public void addPermissionMapping_whenRequestIsSuccessful_returns() {
    AddGithubPermissionMappingRequest addGithubPermissionMappingRequest = new AddGithubPermissionMappingRequest("admin",
      new SonarqubePermissions(true, true, true, true, true, true));

    WsResponse response = mock(WsResponse.class);
    when(response.failIfNotSuccessful()).thenReturn(response);
    when(wsConnector.call(any(PostRequest.class))).thenReturn(response);

    githubPermissionsService.addPermissionMapping(addGithubPermissionMappingRequest);

    ArgumentCaptor<WsRequest> wsRequestArgumentCaptor = ArgumentCaptor.forClass(WsRequest.class);
    verify(wsConnector).call(wsRequestArgumentCaptor.capture());

    WsRequest request = wsRequestArgumentCaptor.getValue();
    assertThat(request.getMethod()).isEqualTo(WsRequest.Method.POST);
    assertThat(request.getPath()).isEqualTo("api/v2/dop-translation/github-permission-mappings");

  }