From: Wouter Admiraal Date: Thu, 12 Aug 2021 09:26:39 +0000 (+0200) Subject: SONAR-13742 The payload should return GitHub API's 'html_url' value rather than ... X-Git-Tag: 9.1.0.47736~150 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ae33251d693b3c52a8952cfe476411238ff5c888;p=sonarqube.git SONAR-13742 The payload should return GitHub API's 'html_url' value rather than 'html' --- diff --git a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubBinding.java b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubBinding.java index ce6e207bf70..fc2c2a77f71 100644 --- a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubBinding.java +++ b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/github/GithubBinding.java @@ -138,8 +138,8 @@ public class GithubBinding { String fullName; @SerializedName("private") boolean isPrivate; - @SerializedName("url") - String url; + @SerializedName("html_url") + String htmlUrl; @SerializedName("default_branch") String defaultBranch; @@ -151,7 +151,7 @@ public class GithubBinding { public Repository toRepository() { return new Repository(this.id, this.name, this.isPrivate, this.fullName, - this.url, this.defaultBranch); + this.htmlUrl, this.defaultBranch); } } } diff --git a/server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/GithubApplicationClientImplTest.java b/server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/GithubApplicationClientImplTest.java index 3b823daab6a..56cf7a30879 100644 --- a/server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/GithubApplicationClientImplTest.java +++ b/server/sonar-alm-client/src/test/java/org/sonar/alm/client/github/GithubApplicationClientImplTest.java @@ -794,7 +794,7 @@ public class GithubApplicationClientImplTest { .get() .extracting(GithubApplicationClient.Repository::getId, GithubApplicationClient.Repository::getName, GithubApplicationClient.Repository::getFullName, GithubApplicationClient.Repository::getUrl, GithubApplicationClient.Repository::isPrivate, GithubApplicationClient.Repository::getDefaultBranch) - .containsOnly(1296269L, "Hello-World", "octocat/Hello-World", "https://github.sonarsource.com/api/v3/repos/octocat/Hello-World", false, "master"); + .containsOnly(1296269L, "Hello-World", "octocat/Hello-World", "https://github.com/octocat/Hello-World", false, "master"); } private AppToken mockAppToken() {