diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-10-02 16:53:41 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-10-05 09:37:17 +0200 |
commit | 2708557c7039f81ef3a536acb0f73fce42e4c490 (patch) | |
tree | cd91f3d20e538b8d2e5cf30f17664bc43f7a7d90 | |
parent | 7992a218b2dd4df3734d38ea1a2a71514d1e2949 (diff) | |
download | sonarqube-2708557c7039f81ef3a536acb0f73fce42e4c490.tar.gz sonarqube-2708557c7039f81ef3a536acb0f73fce42e4c490.zip |
SONAR-6312 Delete RoR WS api/profiles/set_as_default
3 files changed, 1 insertions, 41 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ProfilesWs.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ProfilesWs.java index 426ee92b9a8..6d9df46f23d 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ProfilesWs.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/ProfilesWs.java @@ -38,7 +38,6 @@ public class ProfilesWs implements WebService { defineBackupAction(controller); defineRestoreAction(controller); defineDestroyAction(controller); - defineSetAsDefaultAction(controller); controller.done(); } @@ -106,22 +105,4 @@ public class ProfilesWs implements WebService { .setRequired(true) .setExampleValue("Sonar way"); } - - private static void defineSetAsDefaultAction(NewController controller) { - WebService.NewAction action = controller.createAction("set_as_default") - .setDescription("Set a quality profile as Default. Requires Administer Quality Profiles permission") - .setSince("3.3") - .setPost(true) - .setHandler(RailsHandler.INSTANCE); - - action.createParam("language") - .setDescription("Profile language") - .setRequired(true) - .setExampleValue("java"); - action.createParam("name") - .setDescription("Profile name") - .setRequired(true) - .setExampleValue("Sonar way"); - } - } diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java index b1f354837c2..98ff19fbb65 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProfilesWsTest.java @@ -46,7 +46,7 @@ public class ProfilesWsTest { assertThat(controller).isNotNull(); assertThat(controller.path()).isEqualTo("api/profiles"); assertThat(controller.description()).isNotEmpty(); - assertThat(controller.actions()).hasSize(5); + assertThat(controller.actions()).hasSize(4); } @Test @@ -89,14 +89,4 @@ public class ProfilesWsTest { assertThat(restoreProfiles.handler()).isInstanceOf(RailsHandler.class); assertThat(restoreProfiles.params()).hasSize(2); } - - @Test - public void define_set_as_default_action() { - WebService.Controller controller = tester.controller("api/profiles"); - - WebService.Action restoreProfiles = controller.action("set_as_default"); - assertThat(restoreProfiles).isNotNull(); - assertThat(restoreProfiles.handler()).isInstanceOf(RailsHandler.class); - assertThat(restoreProfiles.params()).hasSize(2); - } } diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb index f76daeefffe..1cb1f19a708 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb @@ -35,17 +35,6 @@ class Api::ProfilesController < Api::ApiController render_success('Profile destroyed') end - # POST /api/profiles/set_as_default?language=<language>&name=<name> - # - # Since v.3.3 - def set_as_default - verify_post_request - profile = Internal.quality_profiles.profile(params[:name], params[:language]) - not_found('Profile not found') unless profile - Internal.component(Java::OrgSonarServerQualityprofile::QProfileService.java_class).setDefault(profile.key) - render_success - end - # GET /api/profiles?language=<language>[&name=<name>] def index require_parameters :language |