From 7fb4681ba4ac8a7739896b150e3f86655e6ce849 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 31 Aug 2016 10:25:01 +0200 Subject: [PATCH] SONAR-7970 SONAR-7986 SONAR-7968 SONAR-7969 api/settings WS should be internal --- .../java/org/sonar/server/setting/ws/ListDefinitionsAction.java | 1 + .../src/main/java/org/sonar/server/setting/ws/ResetAction.java | 1 + .../src/main/java/org/sonar/server/setting/ws/SetAction.java | 1 + .../src/main/java/org/sonar/server/setting/ws/ValuesAction.java | 1 + .../org/sonar/server/setting/ws/ListDefinitionsActionTest.java | 2 +- .../test/java/org/sonar/server/setting/ws/ResetActionTest.java | 2 +- .../test/java/org/sonar/server/setting/ws/SetActionTest.java | 1 + .../test/java/org/sonar/server/setting/ws/ValuesActionTest.java | 2 +- 8 files changed, 8 insertions(+), 3 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ListDefinitionsAction.java b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ListDefinitionsAction.java index 56ba6df717a..b542ef4540c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ListDefinitionsAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ListDefinitionsAction.java @@ -73,6 +73,7 @@ public class ListDefinitionsAction implements SettingsWsAction { "", PARAM_COMPONENT_ID, PARAM_COMPONENT_KEY)) .setResponseExample(getClass().getResource("list_definitions-example.json")) .setSince("6.1") + .setInternal(true) .setHandler(this); addComponentParameters(action); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ResetAction.java b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ResetAction.java index 7f588b24c26..87dda71655a 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ResetAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ResetAction.java @@ -68,6 +68,7 @@ public class ResetAction implements SettingsWsAction { "
  • 'Administer' rights on the specified component
  • " + "", PARAM_COMPONENT_ID, PARAM_COMPONENT_KEY) .setSince("6.1") + .setInternal(true) .setPost(true) .setHandler(this); diff --git a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java index 9c0762a28db..2d6024c4bd4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java @@ -104,6 +104,7 @@ public class SetAction implements SettingsWsAction { PARAM_VALUE, PARAM_VALUES, PARAM_COMPONENT_ID, PARAM_COMPONENT_KEY) .setSince("6.1") + .setInternal(true) .setPost(true) .setHandler(this); diff --git a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ValuesAction.java b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ValuesAction.java index 50d645315a0..4b6bc9b824c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ValuesAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ValuesAction.java @@ -89,6 +89,7 @@ public class ValuesAction implements SettingsWsAction { "", PARAM_COMPONENT_ID, PARAM_COMPONENT_KEY) .setResponseExample(getClass().getResource("values-example.json")) .setSince("6.1") + .setInternal(true) .setHandler(this); addComponentParameters(action); action.createParam(PARAM_KEYS) diff --git a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ListDefinitionsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ListDefinitionsActionTest.java index c1bfd55fda4..5182de8666e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ListDefinitionsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ListDefinitionsActionTest.java @@ -349,7 +349,7 @@ public class ListDefinitionsActionTest { public void test_ws_definition() { WebService.Action action = ws.getDef(); assertThat(action).isNotNull(); - assertThat(action.isInternal()).isFalse(); + assertThat(action.isInternal()).isTrue(); assertThat(action.isPost()).isFalse(); assertThat(action.responseExampleAsString()).isNotEmpty(); assertThat(action.params()).hasSize(2); diff --git a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ResetActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ResetActionTest.java index 70a1e4f29c2..76f7b9c7ac5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ResetActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ResetActionTest.java @@ -180,7 +180,7 @@ public class ResetActionTest { public void test_ws_definition() { WebService.Action action = ws.getDef(); assertThat(action).isNotNull(); - assertThat(action.isInternal()).isFalse(); + assertThat(action.isInternal()).isTrue(); assertThat(action.isPost()).isTrue(); assertThat(action.responseExampleAsString()).isNull(); assertThat(action.params()).hasSize(3); diff --git a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/SetActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/SetActionTest.java index 22217d45598..857ee0bae17 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/SetActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/SetActionTest.java @@ -595,6 +595,7 @@ public class SetActionTest { assertThat(definition.key()).isEqualTo("set"); assertThat(definition.isPost()).isTrue(); + assertThat(definition.isInternal()).isTrue(); assertThat(definition.since()).isEqualTo("6.1"); assertThat(definition.params()).extracting(Param::key) .containsOnly("key", "value", "values", "fieldValues", "componentId", "componentKey"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ValuesActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ValuesActionTest.java index 323b007c72a..6db8874796d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ValuesActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/setting/ws/ValuesActionTest.java @@ -538,7 +538,7 @@ public class ValuesActionTest { public void test_ws_definition() { WebService.Action action = ws.getDef(); assertThat(action).isNotNull(); - assertThat(action.isInternal()).isFalse(); + assertThat(action.isInternal()).isTrue(); assertThat(action.isPost()).isFalse(); assertThat(action.responseExampleAsString()).isNotEmpty(); assertThat(action.params()).hasSize(3); -- 2.39.5