aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-12-04 15:19:04 +0100
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>2017-12-06 14:40:17 +0100
commit2259c6808e011a95fa1d0b8e5681f507befdb4e9 (patch)
treed016cba1c9c3a4f103be3a1b5d25dee709395141 /sonar-ws
parentb6514bf56a49f3e9ad9bd9593e9c678284cfcbf7 (diff)
downloadsonarqube-2259c6808e011a95fa1d0b8e5681f507befdb4e9.tar.gz
sonarqube-2259c6808e011a95fa1d0b8e5681f507befdb4e9.zip
Remove deprecated ProjectAnalysisService
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java8
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java8
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/CreateEventRequest.java83
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/DeleteEventRequest.java34
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/DeleteRequest.java34
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/EventCategory.java44
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysesWsParameters.java35
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysisService.java54
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/SearchRequest.java140
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/UpdateEventRequest.java43
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/package-info.java24
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/CreateEventRequestTest.java76
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysesWsParametersTest.java33
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysisServiceTest.java81
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/SearchRequestTest.java80
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/UpdateEventRequestTest.java65
16 files changed, 0 insertions, 842 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java
index e0cd34ed343..27d06ffac66 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/DefaultWsClient.java
@@ -29,7 +29,6 @@ import org.sonarqube.ws.client.organizations.OrganizationsService;
import org.sonarqube.ws.client.permissions.PermissionsService;
import org.sonarqube.ws.client.project.ProjectsService;
import org.sonarqube.ws.client.projectanalyses.ProjectAnalysesService;
-import org.sonarqube.ws.client.projectanalysis.ProjectAnalysisService;
import org.sonarqube.ws.client.projectbranches.ProjectBranchesService;
import org.sonarqube.ws.client.projectlinks.ProjectLinksService;
import org.sonarqube.ws.client.qualitygates.QualitygatesService;
@@ -74,7 +73,6 @@ class DefaultWsClient implements WsClient {
private final SettingsService settingsService;
private final RootsService rootsService;
private final WebhooksService webhooksService;
- private final ProjectAnalysisService projectAnalysisOld;
private final ProjectAnalysesService projectAnalyses;
private final NotificationsService notificationsService;
private final ProjectBranchesService projectBranchesService;
@@ -102,7 +100,6 @@ class DefaultWsClient implements WsClient {
this.settingsService = new SettingsService(wsConnector);
this.rootsService = new RootsService(wsConnector);
this.webhooksService = new WebhooksService(wsConnector);
- this.projectAnalysisOld = new ProjectAnalysisService(wsConnector);
this.projectAnalyses = new ProjectAnalysesService(wsConnector);
this.projectBranchesService = new ProjectBranchesService(wsConnector);
this.notificationsService = new NotificationsService(wsConnector);
@@ -219,11 +216,6 @@ class DefaultWsClient implements WsClient {
}
@Override
- public ProjectAnalysisService projectAnalysisOld() {
- return projectAnalysisOld;
- }
-
- @Override
public ProjectAnalysesService projectAnalyses() {
return projectAnalyses;
}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java
index 82becf77c3d..1de94f492e4 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/WsClient.java
@@ -29,7 +29,6 @@ import org.sonarqube.ws.client.organizations.OrganizationsService;
import org.sonarqube.ws.client.permissions.PermissionsService;
import org.sonarqube.ws.client.project.ProjectsService;
import org.sonarqube.ws.client.projectanalyses.ProjectAnalysesService;
-import org.sonarqube.ws.client.projectanalysis.ProjectAnalysisService;
import org.sonarqube.ws.client.projectbranches.ProjectBranchesService;
import org.sonarqube.ws.client.projectlinks.ProjectLinksService;
import org.sonarqube.ws.client.qualitygates.QualitygatesService;
@@ -133,13 +132,6 @@ public interface WsClient {
*/
WebhooksService webhooks();
- /**
- * @since 6.3
- * @deprecated since 7.0 use {@link #projectAnalyses()} instead
- */
- @Deprecated
- ProjectAnalysisService projectAnalysisOld();
-
ProjectAnalysesService projectAnalyses();
/**
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/CreateEventRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/CreateEventRequest.java
deleted file mode 100644
index 909d2d757ec..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/CreateEventRequest.java
+++ /dev/null
@@ -1,83 +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.projectanalysis;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-public class CreateEventRequest {
- private final String analysis;
- private final EventCategory category;
- private final String name;
-
- private CreateEventRequest(Builder builder) {
- analysis = builder.analysis;
- category = builder.category;
- name = builder.name;
- }
-
- public String getAnalysis() {
- return analysis;
- }
-
- public EventCategory getCategory() {
- return category;
- }
-
- public String getName() {
- return name;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String analysis;
- private EventCategory category = EventCategory.OTHER;
- private String name;
-
- private Builder() {
- // enforce static factory method
- }
-
- public Builder setAnalysis(String analysis) {
- this.analysis = analysis;
- return this;
- }
-
- public Builder setCategory(EventCategory category) {
- this.category = category;
- return this;
- }
-
- public Builder setName(String name) {
- this.name = name;
- return this;
- }
-
- public CreateEventRequest build() {
- checkArgument(analysis != null, "Analysis key is required");
- checkArgument(category != null, "Category is required");
- checkArgument(name != null, "Name is required");
-
- return new CreateEventRequest(this);
- }
- }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/DeleteEventRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/DeleteEventRequest.java
deleted file mode 100644
index 3b4c3eddfda..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/DeleteEventRequest.java
+++ /dev/null
@@ -1,34 +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.projectanalysis;
-
-import static java.util.Objects.requireNonNull;
-
-public class DeleteEventRequest {
- private final String event;
-
- public DeleteEventRequest(String event) {
- this.event = requireNonNull(event);
- }
-
- public String getEvent() {
- return event;
- }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/DeleteRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/DeleteRequest.java
deleted file mode 100644
index 95590fe75b2..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/DeleteRequest.java
+++ /dev/null
@@ -1,34 +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.projectanalysis;
-
-import static java.util.Objects.requireNonNull;
-
-public class DeleteRequest {
- private final String analysis;
-
- public DeleteRequest(String analysis) {
- this.analysis = requireNonNull(analysis);
- }
-
- public String getAnalysis() {
- return analysis;
- }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/EventCategory.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/EventCategory.java
deleted file mode 100644
index 39305b41ab2..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/EventCategory.java
+++ /dev/null
@@ -1,44 +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.projectanalysis;
-
-public enum EventCategory {
- VERSION("Version"), OTHER("Other"), QUALITY_PROFILE("Profile"), QUALITY_GATE("Alert");
-
- private final String label;
-
- EventCategory(String label) {
- this.label = label;
- }
-
- public String getLabel() {
- return label;
- }
-
- public static EventCategory fromLabel(String label) {
- for (EventCategory category : values()) {
- if (category.getLabel().equals(label)) {
- return category;
- }
- }
-
- throw new IllegalArgumentException("Unknown event category label '" + label + "'");
- }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysesWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysesWsParameters.java
deleted file mode 100644
index 39607605092..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysesWsParameters.java
+++ /dev/null
@@ -1,35 +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.projectanalysis;
-
-public class ProjectAnalysesWsParameters {
- public static final String PARAM_ANALYSIS = "analysis";
- public static final String PARAM_CATEGORY = "category";
- public static final String PARAM_NAME = "name";
- public static final String PARAM_EVENT = "event";
- public static final String PARAM_PROJECT = "project";
- public static final String PARAM_FROM = "from";
- public static final String PARAM_TO = "to";
- public static final String PARAM_BRANCH = "branch";
-
- private ProjectAnalysesWsParameters() {
- // static access only
- }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysisService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysisService.java
deleted file mode 100644
index cf4ca3cf831..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysisService.java
+++ /dev/null
@@ -1,54 +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.projectanalysis;
-
-import org.sonarqube.ws.ProjectAnalyses.SearchResponse;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.WsConnector;
-
-import static org.sonar.api.server.ws.WebService.Param.PAGE;
-import static org.sonar.api.server.ws.WebService.Param.PAGE_SIZE;
-import static org.sonarqube.ws.client.projectanalysis.ProjectAnalysesWsParameters.PARAM_BRANCH;
-import static org.sonarqube.ws.client.projectanalysis.ProjectAnalysesWsParameters.PARAM_CATEGORY;
-import static org.sonarqube.ws.client.projectanalysis.ProjectAnalysesWsParameters.PARAM_PROJECT;
-
-/**
- * @deprecated since 7.0, use {@link org.sonarqube.ws.client.projectanalyses.ProjectAnalysesService} instead
- */
-@Deprecated
-public class ProjectAnalysisService extends BaseService {
-
- public ProjectAnalysisService(WsConnector wsConnector) {
- super(wsConnector, "api/project_analyses");
- }
-
- public SearchResponse search(SearchRequest searchRequest) {
- EventCategory eventCategory = searchRequest.getCategory();
- GetRequest request = new GetRequest(path("search"))
- .setParam(PARAM_PROJECT, searchRequest.getProject())
- .setParam(PARAM_BRANCH, searchRequest.getBranch())
- .setParam(PARAM_CATEGORY, eventCategory == null ? null : eventCategory.name())
- .setParam(PAGE, searchRequest.getPage())
- .setParam(PAGE_SIZE, searchRequest.getPageSize());
- return call(request, SearchResponse.parser());
- }
-
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/SearchRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/SearchRequest.java
deleted file mode 100644
index c415d62b6ad..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/SearchRequest.java
+++ /dev/null
@@ -1,140 +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.projectanalysis;
-
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static java.util.Objects.requireNonNull;
-
-public class SearchRequest {
- public static final int DEFAULT_PAGE_SIZE = 100;
- public static final int MAX_SIZE = 500;
-
- private final String project;
- private final String branch;
- private final EventCategory category;
- private final int page;
- private final int pageSize;
- private final String from;
- private final String to;
-
- private SearchRequest(Builder builder) {
- this.project = builder.project;
- this.branch= builder.branch;
- this.category = builder.category;
- this.page = builder.page;
- this.pageSize = builder.pageSize;
- this.from = builder.from;
- this.to = builder.to;
- }
-
- public String getProject() {
- return project;
- }
-
- @CheckForNull
- public String getBranch() {
- return branch;
- }
-
- @CheckForNull
- public EventCategory getCategory() {
- return category;
- }
-
- public int getPage() {
- return page;
- }
-
- public int getPageSize() {
- return pageSize;
- }
-
- @CheckForNull
- public String getFrom() {
- return from;
- }
-
- @CheckForNull
- public String getTo() {
- return to;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String project;
- private String branch;
- private EventCategory category;
- private int page = 1;
- private int pageSize = DEFAULT_PAGE_SIZE;
- private String from;
- private String to;
-
- private Builder() {
- // enforce static factory method
- }
-
- public Builder setProject(String project) {
- this.project = project;
- return this;
- }
-
- public Builder setBranch(@Nullable String branch) {
- this.branch = branch;
- return this;
- }
-
- public Builder setCategory(@Nullable EventCategory category) {
- this.category = category;
- return this;
- }
-
- public Builder setPage(int page) {
- this.page = page;
- return this;
- }
-
- public Builder setPageSize(int pageSize) {
- this.pageSize = pageSize;
- return this;
- }
-
- public Builder setFrom(@Nullable String from) {
- this.from = from;
- return this;
- }
-
- public Builder setTo(@Nullable String to) {
- this.to = to;
- return this;
- }
-
- public SearchRequest build() {
- requireNonNull(project, "Project is required");
- checkArgument(pageSize <= MAX_SIZE, "Page size must be lower than or equal to " + MAX_SIZE);
- return new SearchRequest(this);
- }
- }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/UpdateEventRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/UpdateEventRequest.java
deleted file mode 100644
index 27dbbf77730..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/UpdateEventRequest.java
+++ /dev/null
@@ -1,43 +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.projectanalysis;
-
-import javax.annotation.CheckForNull;
-
-import static java.util.Objects.requireNonNull;
-
-public class UpdateEventRequest {
- private final String event;
- private final String name;
-
- public UpdateEventRequest(String event, String name) {
- this.event = requireNonNull(event, "Event key is required");
- this.name = requireNonNull(name, "Name is required");
- }
-
- public String getEvent() {
- return event;
- }
-
- @CheckForNull
- public String getName() {
- return name;
- }
-}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/package-info.java
deleted file mode 100644
index 7ffc784f651..00000000000
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectanalysis/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.projectanalysis;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/CreateEventRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/CreateEventRequestTest.java
deleted file mode 100644
index 41bac7caf0b..00000000000
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/CreateEventRequestTest.java
+++ /dev/null
@@ -1,76 +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.projectanalysis;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.sonarqube.ws.client.projectanalysis.EventCategory.OTHER;
-import static org.sonarqube.ws.client.projectanalysis.EventCategory.VERSION;
-
-public class CreateEventRequestTest {
-
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- private CreateEventRequest.Builder underTest = CreateEventRequest.builder();
-
- @Test
- public void build_request() {
- CreateEventRequest result = underTest.setAnalysis("P1").setCategory(OTHER).setName("name").build();
-
- assertThat(result.getAnalysis()).isEqualTo("P1");
- assertThat(result.getCategory()).isEqualTo(OTHER);
- assertThat(result.getName()).isEqualTo("name");
- }
-
- @Test
- public void other_category_by_default() {
- CreateEventRequest result = underTest.setAnalysis("P1").setName("name").build();
-
- assertThat(OTHER).isEqualTo(result.getCategory());
- }
-
- @Test
- public void fail_when_no_category() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Category is required");
-
- underTest.setAnalysis("P1").setName("name").setCategory(null).build();
- }
-
- @Test
- public void fail_when_no_analysis() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Analysis key is required");
-
- underTest.setCategory(VERSION).setName("name").build();
- }
-
- @Test
- public void fail_when_no_name() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Name is required");
-
- underTest.setAnalysis("P1").setCategory(VERSION).build();
- }
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysesWsParametersTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysesWsParametersTest.java
deleted file mode 100644
index d72c477b6a5..00000000000
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysesWsParametersTest.java
+++ /dev/null
@@ -1,33 +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.projectanalysis;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.sonar.test.TestUtils.hasOnlyPrivateConstructors;
-
-public class ProjectAnalysesWsParametersTest {
-
- @Test
- public void private_access_only() {
- assertThat(hasOnlyPrivateConstructors(ProjectAnalysesWsParameters.class)).isTrue();
- }
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysisServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysisServiceTest.java
deleted file mode 100644
index 8139bd00434..00000000000
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/ProjectAnalysisServiceTest.java
+++ /dev/null
@@ -1,81 +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.projectanalysis;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonarqube.ws.ProjectAnalyses;
-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;
-import static org.sonar.api.server.ws.WebService.Param.PAGE;
-import static org.sonar.api.server.ws.WebService.Param.PAGE_SIZE;
-import static org.sonarqube.ws.client.projectanalysis.EventCategory.QUALITY_GATE;
-import static org.sonarqube.ws.client.projectanalysis.ProjectAnalysesWsParameters.PARAM_BRANCH;
-import static org.sonarqube.ws.client.projectanalysis.ProjectAnalysesWsParameters.PARAM_CATEGORY;
-import static org.sonarqube.ws.client.projectanalysis.ProjectAnalysesWsParameters.PARAM_PROJECT;
-
-public class ProjectAnalysisServiceTest {
-
- @Rule
- public ServiceTester<ProjectAnalysisService> serviceTester = new ServiceTester<>(new ProjectAnalysisService(mock(WsConnector.class)));
-
- private ProjectAnalysisService underTest = serviceTester.getInstanceUnderTest();
-
- @Test
- public void search() {
- underTest.search(SearchRequest.builder()
- .setProject("project")
- .setBranch("my_branch")
- .setCategory(QUALITY_GATE)
- .setPage(10)
- .setPageSize(50)
- .build());
- GetRequest getRequest = serviceTester.getGetRequest();
-
- assertThat(serviceTester.getGetParser()).isSameAs(ProjectAnalyses.SearchResponse.parser());
- serviceTester.assertThat(getRequest)
- .hasParam(PARAM_PROJECT, "project")
- .hasParam(PARAM_BRANCH, "my_branch")
- .hasParam(PARAM_CATEGORY, QUALITY_GATE.name())
- .hasParam(PAGE, 10)
- .hasParam(PAGE_SIZE, 50)
- .andNoOtherParam();
- }
-
- @Test
- public void search_with_minimal_fields() {
- underTest.search(SearchRequest.builder()
- .setProject("project")
- .build());
- GetRequest getRequest = serviceTester.getGetRequest();
-
- assertThat(serviceTester.getGetParser()).isSameAs(ProjectAnalyses.SearchResponse.parser());
- serviceTester.assertThat(getRequest)
- .hasParam(PARAM_PROJECT, "project")
- .hasParam(PAGE, 1)
- .hasParam(PAGE_SIZE, 100)
- .andNoOtherParam();
- }
-
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/SearchRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/SearchRequestTest.java
deleted file mode 100644
index 4abe04fa8a4..00000000000
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/SearchRequestTest.java
+++ /dev/null
@@ -1,80 +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.projectanalysis;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.sonarqube.ws.client.projectanalysis.EventCategory.QUALITY_GATE;
-
-public class SearchRequestTest {
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- private SearchRequest.Builder underTest = SearchRequest.builder();
-
- @Test
- public void search_request() {
- SearchRequest result = underTest
- .setProject("P1")
- .setBranch("my_branch")
- .setCategory(QUALITY_GATE)
- .setPage(2)
- .setPageSize(500)
- .setFrom("2016-01-01")
- .setTo("2017-07-01")
- .build();
-
- assertThat(result.getProject()).isEqualTo("P1");
- assertThat(result.getBranch()).isEqualTo("my_branch");
- assertThat(result.getPage()).isEqualTo(2);
- assertThat(result.getPageSize()).isEqualTo(500);
- assertThat(result.getCategory()).isEqualTo(QUALITY_GATE);
- assertThat(result.getFrom()).isEqualTo("2016-01-01");
- assertThat(result.getTo()).isEqualTo("2017-07-01");
- }
-
- @Test
- public void page_default_values() {
- SearchRequest result = underTest.setProject("P1").build();
-
- assertThat(result.getPage()).isEqualTo(1);
- assertThat(result.getPageSize()).isEqualTo(100);
- }
-
- @Test
- public void fail_if_project_is_null() {
- expectedException.expect(NullPointerException.class);
-
- underTest.build();
- }
-
- @Test
- public void fail_if_page_size_greater_than_500() {
- expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Page size must be lower than or equal to 500");
-
- underTest.setProject("P1")
- .setPageSize(501)
- .build();
- }
-}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/UpdateEventRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/UpdateEventRequestTest.java
deleted file mode 100644
index a5321c695a9..00000000000
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/projectanalysis/UpdateEventRequestTest.java
+++ /dev/null
@@ -1,65 +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.projectanalysis;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class UpdateEventRequestTest {
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- private UpdateEventRequest underTest;
-
- @Test
- public void request_with_name_only() {
- underTest = new UpdateEventRequest("E1", "name");
-
- assertThat(underTest.getEvent()).isEqualTo("E1");
- assertThat(underTest.getName()).isEqualTo("name");
- }
-
- @Test
- public void request_with_all_parameters() {
- underTest = new UpdateEventRequest("E1", "name");
-
- assertThat(underTest.getEvent()).isEqualTo("E1");
- assertThat(underTest.getName()).isEqualTo("name");
- }
-
- @Test
- public void fail_if_null_event() {
- expectedException.expect(NullPointerException.class);
- expectedException.expectMessage("Event key is required");
-
- new UpdateEventRequest(null, "name");
- }
-
- @Test
- public void fail_if_name_not_provided() {
- expectedException.expect(NullPointerException.class);
- expectedException.expectMessage("Name is required");
-
- new UpdateEventRequest("E1", null);
- }
-}