From 28431eb1bf36237a8119bbce726daba1a5449ced Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Tue, 29 Mar 2016 18:50:35 +0200 Subject: [PATCH] SONAR-7472 Drop WS api/issues/create --- .../sonar/server/issue/ws/CreateAction.java | 67 ------------------- .../sonar/server/issue/ws/IssueWsModule.java | 1 - .../server/issue/ws/CreateActionTest.java | 39 ----------- .../server/issue/ws/IssueWsModuleTest.java | 2 +- 4 files changed, 1 insertion(+), 108 deletions(-) delete mode 100644 server/sonar-server/src/main/java/org/sonar/server/issue/ws/CreateAction.java delete mode 100644 server/sonar-server/src/test/java/org/sonar/server/issue/ws/CreateActionTest.java diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/CreateAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/CreateAction.java deleted file mode 100644 index a54b2628fd6..00000000000 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/CreateAction.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.issue.ws; - -import org.sonar.api.rule.Severity; -import org.sonar.api.server.ws.Request; -import org.sonar.api.server.ws.Response; -import org.sonar.api.server.ws.WebService; - -import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001; - -public class CreateAction implements IssuesWsAction { - - public static final String ACTION = "create"; - - @Override - public void define(WebService.NewController controller) { - WebService.NewAction action = controller.createAction(ACTION) - .setDescription("Deprecated web service to do create a manual issue. Manual issue feature has been removed in 5.5. This web service has no effect.") - .setSince("3.6") - .setDeprecatedSince("5.5") - .setHandler(this) - .setPost(true); - - action.createParam("component") - .setDescription("Key of the component on which to log the issue") - .setRequired(true) - .setExampleValue(KEY_PROJECT_EXAMPLE_001); - action.createParam("rule") - .setDescription("Manual rule key") - .setRequired(true) - .setExampleValue("manual:performance"); - action.createParam("severity") - .setDescription("Severity of the issue") - .setExampleValue(Severity.BLOCKER + "," + Severity.CRITICAL) - .setPossibleValues(Severity.ALL); - action.createParam("line") - .setDescription("Line on which to log the issue. " + - "If no line is specified, the issue is attached to the component and not to a specific line") - .setExampleValue("15"); - action.createParam("message") - .setDescription("Description of the issue") - .setExampleValue("blabla..."); - } - - @Override - public void handle(Request request, Response response) throws Exception { - response.noContent(); - } -} diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueWsModule.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueWsModule.java index a2e7c0fcf27..b6df29298d9 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueWsModule.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueWsModule.java @@ -30,7 +30,6 @@ public class IssueWsModule extends Module { SearchResponseFormat.class, OperationResponseWriter.class, AssignAction.class, - CreateAction.class, DoTransitionAction.class, SearchAction.class, SetSeverityAction.class, diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/CreateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/CreateActionTest.java deleted file mode 100644 index cfccf1c9e54..00000000000 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/CreateActionTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.issue.ws; - -import org.junit.Test; -import org.sonar.server.ws.WsAction; -import org.sonar.server.ws.WsActionTester; - -public class CreateActionTest { - - WsAction underTest = new CreateAction(); - WsActionTester tester = new WsActionTester(underTest); - - @Test - public void does_nothing() throws Exception { - tester.newRequest() - .setParam("component", "FILE_KEY") - .setParam("rule", "ruleKey") - .execute(); - } - -} diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueWsModuleTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueWsModuleTest.java index 5ce2b6b6ffc..5021d11e4ce 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueWsModuleTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueWsModuleTest.java @@ -29,6 +29,6 @@ public class IssueWsModuleTest { public void verify_count_of_added_components() { ComponentContainer container = new ComponentContainer(); new IssueWsModule().configure(container); - assertThat(container.size()).isEqualTo(2 + 14); + assertThat(container.size()).isEqualTo(2 + 13); } } -- 2.39.5