aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-10-11 18:42:33 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-10-16 09:36:55 +0200
commit36e1afc3d93ab23b01bb3911d311f157ef8c8fb0 (patch)
treee18b1c6c4f0cdac1ca9219ec41147be7aae9df1a /sonar-ws/src
parentbbec8759238610b63147422338ce4fdd23b53570 (diff)
downloadsonarqube-36e1afc3d93ab23b01bb3911d311f157ef8c8fb0.tar.gz
sonarqube-36e1afc3d93ab23b01bb3911d311f157ef8c8fb0.zip
SONAR-9863 drop internal WS api/server_id and api/licenses
Diffstat (limited to 'sonar-ws/src')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/license/LicensesService.java41
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/license/LicensesWsParameters.java31
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/license/package-info.java24
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/serverid/GenerateRequest.java72
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/serverid/package-info.java26
-rw-r--r--sonar-ws/src/main/protobuf/ws-licenses.proto52
-rw-r--r--sonar-ws/src/main/protobuf/ws-serverid.proto39
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/license/LicensesServiceTest.java48
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/serverid/GenerateRequestTest.java64
9 files changed, 0 insertions, 397 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/license/LicensesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/license/LicensesService.java
deleted file mode 100644
index df939244dfd..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/license/LicensesService.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.sonarqube.ws.client.license;
-
-import org.sonarqube.ws.Licenses.ListWsResponse;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.sonarqube.ws.client.license.LicensesWsParameters.ACTION_LIST;
-import static org.sonarqube.ws.client.license.LicensesWsParameters.CONTROLLER_SETTINGS;
-
-public class LicensesService extends BaseService {
-
- public LicensesService(WsConnector wsConnector) {
- super(wsConnector, CONTROLLER_SETTINGS);
- }
-
- public ListWsResponse list() {
- GetRequest getRequest = new GetRequest(path(ACTION_LIST));
- return call(getRequest, ListWsResponse.parser());
- }
-
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/license/LicensesWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/license/LicensesWsParameters.java
deleted file mode 100644
index 01a92d89694..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/license/LicensesWsParameters.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.sonarqube.ws.client.license;
-
-public class LicensesWsParameters {
- public static final String CONTROLLER_SETTINGS = "api/licenses";
-
- public static final String ACTION_LIST = "list";
-
- private LicensesWsParameters() {
- // Only static stuff
- }
-
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/license/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/license/package-info.java
deleted file mode 100644
index 11e94a36de9..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/license/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.
- */
-@ParametersAreNonnullByDefault
-package org.sonarqube.ws.client.license;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/serverid/GenerateRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/serverid/GenerateRequest.java
deleted file mode 100644
index ad1bb8766c4..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/serverid/GenerateRequest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.sonarqube.ws.client.serverid;
-
-import javax.annotation.concurrent.Immutable;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-@Immutable
-public class GenerateRequest {
- private final String organization;
- private final String ip;
-
- private GenerateRequest(Builder builder) {
- this.organization = builder.organization;
- this.ip = builder.ip;
- }
-
- public String getOrganization() {
- return organization;
- }
-
- public String getIp() {
- return ip;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String organization;
- private String ip;
-
- private Builder() {
- // enforce static constructor
- }
-
- public Builder setOrganization(String organization) {
- this.organization = organization;
- return this;
- }
-
- public Builder setIp(String ip) {
- this.ip = ip;
- return this;
- }
-
- public GenerateRequest build() {
- checkArgument(organization != null && !organization.isEmpty(), "Organization must not be null or empty");
- checkArgument(ip != null && !ip.isEmpty(), "IP must not be null or empty");
- return new GenerateRequest(this);
- }
- }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/serverid/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/serverid/package-info.java
deleted file mode 100644
index f00dce491fd..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/serverid/package-info.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.
- */
-
-
-@ParametersAreNonnullByDefault
-package org.sonarqube.ws.client.serverid;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/main/protobuf/ws-licenses.proto b/sonar-ws/src/main/protobuf/ws-licenses.proto
deleted file mode 100644
index ff995af954d..00000000000
--- a/sonar-ws/src/main/protobuf/ws-licenses.proto
+++ /dev/null
@@ -1,52 +0,0 @@
-// SonarQube, open source software quality management tool.
-// Copyright (C) 2008-2016 SonarSource
-// mailto:contact AT sonarsource DOT com
-//
-// SonarQube 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.
-//
-// SonarQube 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.
-
-syntax = "proto2";
-
-package sonarqube.ws.licenses;
-
-option java_package = "org.sonarqube.ws";
-option java_outer_classname = "Licenses";
-option optimize_for = SPEED;
-
-// Response of GET api/licenses/list
-message ListWsResponse {
- repeated License licenses = 1;
-}
-
-message License {
- optional string key = 1;
- optional string name = 2;
- optional string value = 3;
- optional string product = 4;
- optional string organization = 5;
- optional string expiration = 6;
- optional string serverId = 7;
- optional string type = 8;
- optional AdditionalProperties additionalProperties = 9;
- optional bool invalidProduct = 10;
- optional bool invalidExpiration = 11;
- optional bool invalidServerId = 12;
-}
-
-message AdditionalProperties {
- map<string, string> additionalProperties = 1;
-}
-
-
-
diff --git a/sonar-ws/src/main/protobuf/ws-serverid.proto b/sonar-ws/src/main/protobuf/ws-serverid.proto
deleted file mode 100644
index 8ccef5292f9..00000000000
--- a/sonar-ws/src/main/protobuf/ws-serverid.proto
+++ /dev/null
@@ -1,39 +0,0 @@
-// SonarQube, open source software quality management tool.
-// Copyright (C) 2008-2016 SonarSource
-// mailto:contact AT sonarsource DOT com
-//
-// SonarQube 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.
-//
-// SonarQube 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.
-
-syntax = "proto2";
-
-package sonarqube.ws.serverid;
-
-option java_package = "org.sonarqube.ws";
-option java_outer_classname = "ServerId";
-option optimize_for = SPEED;
-
-// Response of GET api/server_id/show
-message ShowWsResponse {
- optional string serverId = 1;
- optional string organization = 2;
- optional string ip = 3;
- repeated string validIpAddresses = 4;
- optional bool invalidServerId = 5;
-}
-
-// Response of POST api/server_id/generate
-message GenerateWsResponse {
- optional string serverId = 1;
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/license/LicensesServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/license/LicensesServiceTest.java
deleted file mode 100644
index 5ebaa4ef0ec..00000000000
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/license/LicensesServiceTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.sonarqube.ws.client.license;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonarqube.ws.Licenses.ListWsResponse;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.ServiceTester;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-
-public class LicensesServiceTest {
-
- @Rule
- public ServiceTester<LicensesService> serviceTester = new ServiceTester<>(new LicensesService(mock(WsConnector.class)));
-
- private LicensesService underTest = serviceTester.getInstanceUnderTest();
-
- @Test
- public void list_definitions() {
- underTest.list();
- GetRequest getRequest = serviceTester.getGetRequest();
-
- assertThat(serviceTester.getGetParser()).isSameAs(ListWsResponse.parser());
- serviceTester.assertThat(getRequest).andNoOtherParam();
- }
-
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/serverid/GenerateRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/serverid/GenerateRequestTest.java
deleted file mode 100644
index a1366f0fde7..00000000000
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/serverid/GenerateRequestTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.sonarqube.ws.client.serverid;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-public class GenerateRequestTest {
-
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- GenerateRequest.Builder underTest = GenerateRequest.builder();
-
- @Test
- public void fail_if_null_organization() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Organization must not be null or empty");
-
- underTest.setIp("127.0.0.1").setOrganization(null).build();
- }
-
- @Test
- public void fail_if_empty_organization() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Organization must not be null or empty");
-
- underTest.setIp("127.0.0.1").setOrganization("").build();
- }
-
- @Test
- public void fail_if_null_ip() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("IP must not be null or empty");
-
- underTest.setOrganization("SonarSource").setIp(null).build();
- }
-
- @Test
- public void fail_if_empty_ip() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("IP must not be null or empty");
-
- underTest.setOrganization("SonarSource").setIp("").build();
- }
-}