diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2019-10-14 16:28:14 -0500 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-10-30 20:21:08 +0100 |
commit | aa1c78266501b7ae53a6d553182f816aab28c362 (patch) | |
tree | 6182159f8dbed4086af3dd81a8adcc9d493a30a5 /sonar-scanner-engine | |
parent | dcd9175e8b4bd48c9cfc01690b4aeb1fff96e0f5 (diff) | |
download | sonarqube-aa1c78266501b7ae53a6d553182f816aab28c362.tar.gz sonarqube-aa1c78266501b7ae53a6d553182f816aab28c362.zip |
SONAR-11154 Remove parameters deprecated before 6.7 and enforce mandatory parameters
Diffstat (limited to 'sonar-scanner-engine')
2 files changed, 8 insertions, 8 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/DefaultQualityProfileLoader.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/DefaultQualityProfileLoader.java index 7bf41b77a93..5fe74d33d93 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/DefaultQualityProfileLoader.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/repository/DefaultQualityProfileLoader.java @@ -57,7 +57,7 @@ public class DefaultQualityProfileLoader implements QualityProfileLoader { @Override public List<QualityProfile> load(String projectKey) { - StringBuilder url = new StringBuilder(WS_URL + "?projectKey=").append(encodeForUrl(projectKey)); + StringBuilder url = new StringBuilder(WS_URL + "?project=").append(encodeForUrl(projectKey)); return handleErrors(url, () -> String.format("Failed to load the quality profiles of project '%s'", projectKey), true); } diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultQualityProfileLoaderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultQualityProfileLoaderTest.java index edfc14e5bd6..f5d3661dff9 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultQualityProfileLoaderTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/DefaultQualityProfileLoaderTest.java @@ -51,14 +51,14 @@ public class DefaultQualityProfileLoaderTest { public void load_gets_all_profiles_for_specified_project() throws IOException { prepareCallWithResults(); underTest.load("foo"); - verifyCalledPath("/api/qualityprofiles/search.protobuf?projectKey=foo"); + verifyCalledPath("/api/qualityprofiles/search.protobuf?project=foo"); } @Test public void load_encodes_url_parameters() throws IOException { - WsTestUtil.mockStream(wsClient, "/api/qualityprofiles/search.protobuf?projectKey=foo%232", createStreamOfProfiles("qp")); + WsTestUtil.mockStream(wsClient, "/api/qualityprofiles/search.protobuf?project=foo%232", createStreamOfProfiles("qp")); underTest.load("foo#2"); - verifyCalledPath("/api/qualityprofiles/search.protobuf?projectKey=foo%232"); + verifyCalledPath("/api/qualityprofiles/search.protobuf?project=foo%232"); } @Test @@ -66,18 +66,18 @@ public class DefaultQualityProfileLoaderTest { when(properties.organizationKey()).thenReturn(Optional.of("my-org")); prepareCallWithResults(); underTest.load("foo"); - verifyCalledPath("/api/qualityprofiles/search.protobuf?projectKey=foo&organization=my-org"); + verifyCalledPath("/api/qualityprofiles/search.protobuf?project=foo&organization=my-org"); } @Test public void load_tries_default_if_no_profiles_found_for_project() throws IOException { HttpException e = new HttpException("", 404, "{\"errors\":[{\"msg\":\"No project found with key 'foo'\"}]}"); - WsTestUtil.mockException(wsClient, "/api/qualityprofiles/search.protobuf?projectKey=foo", e); + WsTestUtil.mockException(wsClient, "/api/qualityprofiles/search.protobuf?project=foo", e); WsTestUtil.mockStream(wsClient, "/api/qualityprofiles/search.protobuf?defaults=true", createStreamOfProfiles("qp")); underTest.load("foo"); - verifyCalledPath("/api/qualityprofiles/search.protobuf?projectKey=foo"); + verifyCalledPath("/api/qualityprofiles/search.protobuf?project=foo"); verifyCalledPath("/api/qualityprofiles/search.protobuf?defaults=true"); } @@ -86,7 +86,7 @@ public class DefaultQualityProfileLoaderTest { when(properties.organizationKey()).thenReturn(Optional.of("my-org")); HttpException e = new HttpException("", 404, "{\"errors\":[{\"msg\":\"No organization with key 'myorg'\"}]}"); - WsTestUtil.mockException(wsClient, "/api/qualityprofiles/search.protobuf?projectKey=foo&organization=my-org", e); + WsTestUtil.mockException(wsClient, "/api/qualityprofiles/search.protobuf?project=foo&organization=my-org", e); WsTestUtil.mockStream(wsClient, "/api/qualityprofiles/search.protobuf?defaults=true&organization=my-org", createStreamOfProfiles("qp")); underTest.load("foo"); |