aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2019-08-08 11:22:13 +0200
committerSonarTech <sonartech@sonarsource.com>2019-08-14 20:21:12 +0200
commit980b9f16b8a34364489d2ed3a8472f725eea4770 (patch)
treecf6e56931905baa05ae17de93d803ccbdd4c75f0
parent28147b8b05a5244c93e13b51924acfc683bd93f6 (diff)
downloadsonarqube-980b9f16b8a34364489d2ed3a8472f725eea4770.tar.gz
sonarqube-980b9f16b8a34364489d2ed3a8472f725eea4770.zip
create sonar-webserver-es from sonar-server
ie. move WS engine to dedicated project
-rw-r--r--server/sonar-server/build.gradle2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/ws/IssueWsModule.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java30
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java7
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/ws/DeprecatedPropertiesWsFilter.java22
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceFilter.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/ws/WsResponseCommonFormat.java59
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/ws/package-info.java1
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/ws/IssueWsModuleTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsTest.java3
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionFacetsTest.java3
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java5
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTestOnSonarCloud.java3
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/ws/DeprecatedPropertiesWsFilterTest.java3
-rw-r--r--server/sonar-webserver-ws/build.gradle42
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/BadRequestException.java (renamed from server/sonar-server/src/main/java/org/sonar/server/exceptions/BadRequestException.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/ForbiddenException.java (renamed from server/sonar-server/src/main/java/org/sonar/server/exceptions/ForbiddenException.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/Message.java (renamed from server/sonar-server/src/main/java/org/sonar/server/exceptions/Message.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/NotFoundException.java (renamed from server/sonar-server/src/main/java/org/sonar/server/exceptions/NotFoundException.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/ServerException.java (renamed from server/sonar-server/src/main/java/org/sonar/server/exceptions/ServerException.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/UnauthorizedException.java (renamed from server/sonar-server/src/main/java/org/sonar/server/exceptions/UnauthorizedException.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/package-info.java (renamed from server/sonar-server/src/main/java/org/sonar/server/exceptions/package-info.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/CacheWriter.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/CacheWriter.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/DefaultLocalResponse.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/DefaultLocalResponse.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/JsonWriterUtils.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/JsonWriterUtils.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/KeyExamples.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/KeyExamples.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/LocalRequestAdapter.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/LocalRequestAdapter.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/RemovedWebServiceHandler.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/RemovedWebServiceHandler.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/RequestVerifier.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/RequestVerifier.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletFilterHandler.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/ServletFilterHandler.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletRequest.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/ServletRequest.java)4
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletResponse.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/ServletResponse.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WebServiceEngine.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WsAction.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/WsAction.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WsParameterBuilder.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/WsParameterBuilder.java)0
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WsUtils.java (renamed from server/sonar-server/src/main/java/org/sonar/server/ws/WsUtils.java)7
-rw-r--r--server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/package-info.java23
-rw-r--r--server/sonar-webserver-ws/src/main/resources/org/sonar/server/ws/removed-ws-example.json (renamed from server/sonar-server/src/main/resources/org/sonar/server/ws/removed-ws-example.json)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/CacheWriterTest.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/CacheWriterTest.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/DumbResponse.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/DumbResponse.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/RemovedWebServiceHandlerTest.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/RemovedWebServiceHandlerTest.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/ServletRequestTest.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/ServletRequestTest.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/ServletResponseTest.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/ServletResponseTest.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestRequest.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/TestRequest.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestResponse.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/TestResponse.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsActionTester.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/WsActionTester.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsTester.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/WsTester.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsUtilsTest.java (renamed from server/sonar-server/src/test/java/org/sonar/server/ws/WsUtilsTest.java)0
-rw-r--r--server/sonar-webserver-ws/src/test/resources/logback-test.xml26
-rw-r--r--settings.gradle1
51 files changed, 144 insertions, 105 deletions
diff --git a/server/sonar-server/build.gradle b/server/sonar-server/build.gradle
index 3efd483fbd9..d15997a4a14 100644
--- a/server/sonar-server/build.gradle
+++ b/server/sonar-server/build.gradle
@@ -50,6 +50,7 @@ dependencies {
compile project(':server:sonar-db-migration')
compile project(':server:sonar-process')
compile project(':server:sonar-server-common')
+ compile project(':server:sonar-webserver-ws')
compile project(':sonar-core')
compile project(':sonar-duplications')
compile project(':sonar-scanner-protocol')
@@ -80,6 +81,7 @@ dependencies {
testCompile project(':server:sonar-db-testing')
testCompile project(path: ":server:sonar-server-common", configuration: "tests")
testCompile project(':sonar-testing-harness')
+ testCompile project(path: ":server:sonar-webserver-ws", configuration: "tests")
runtime 'io.jsonwebtoken:jjwt-jackson'
}
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 2fb05802fa9..30b70b5f08a 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
@@ -31,7 +31,6 @@ import org.sonar.server.issue.workflow.IssueWorkflow;
import org.sonar.server.qualitygate.changeevent.QGChangeEventListenersImpl;
import org.sonar.server.settings.ProjectConfigurationLoaderImpl;
import org.sonar.server.webhook.WebhookQGChangeEventListener;
-import org.sonar.server.ws.WsResponseCommonFormat;
public class IssueWsModule extends Module {
@Override
@@ -50,7 +49,6 @@ public class IssueWsModule extends Module {
SearchResponseLoader.class,
SearchResponseFormat.class,
OperationResponseWriter.class,
- WsResponseCommonFormat.class,
AddCommentAction.class,
EditCommentAction.class,
DeleteCommentAction.class,
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java
index 9a92a1db6fb..2f17f592203 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SearchResponseFormat.java
@@ -44,7 +44,6 @@ import org.sonar.db.user.UserDto;
import org.sonar.markdown.Markdown;
import org.sonar.server.es.Facets;
import org.sonar.server.issue.workflow.Transition;
-import org.sonar.server.ws.WsResponseCommonFormat;
import org.sonarqube.ws.Common;
import org.sonarqube.ws.Issues;
import org.sonarqube.ws.Issues.Actions;
@@ -77,13 +76,11 @@ import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_RULES;
public class SearchResponseFormat {
private final Durations durations;
- private final WsResponseCommonFormat commonFormat;
private final Languages languages;
private final AvatarResolver avatarFactory;
- public SearchResponseFormat(Durations durations, WsResponseCommonFormat commonFormat, Languages languages, AvatarResolver avatarFactory) {
+ public SearchResponseFormat(Durations durations, Languages languages, AvatarResolver avatarFactory) {
this.durations = durations;
- this.commonFormat = commonFormat;
this.languages = languages;
this.avatarFactory = avatarFactory;
}
@@ -138,7 +135,14 @@ public class SearchResponseFormat {
response.setP(paging.pageIndex());
response.setPs(paging.pageSize());
response.setTotal(paging.total());
- response.setPaging(commonFormat.formatPaging(paging));
+ response.setPaging(formatPaging(paging));
+ }
+
+ private Common.Paging.Builder formatPaging(Paging paging) {
+ return Common.Paging.newBuilder()
+ .setPageIndex(paging.pageIndex())
+ .setPageSize(paging.pageSize())
+ .setTotal(paging.total());
}
private List<Issues.Issue> formatIssues(Set<SearchAdditionalField> fields, SearchResponseData data) {
@@ -316,11 +320,25 @@ public class SearchResponseFormat {
Common.Rules.Builder wsRules = Common.Rules.newBuilder();
List<RuleDefinitionDto> rules = firstNonNull(data.getRules(), emptyList());
for (RuleDefinitionDto rule : rules) {
- wsRules.addRules(commonFormat.formatRule(rule));
+ wsRules.addRules(formatRule(rule));
}
return wsRules;
}
+ private Common.Rule.Builder formatRule(RuleDefinitionDto rule) {
+ Common.Rule.Builder builder = Common.Rule.newBuilder()
+ .setKey(rule.getKey().toString())
+ .setName(nullToEmpty(rule.getName()))
+ .setStatus(Common.RuleStatus.valueOf(rule.getStatus().name()));
+
+ builder.setLang(nullToEmpty(rule.getLanguage()));
+ Language lang = languages.get(rule.getLanguage());
+ if (lang != null) {
+ builder.setLangName(lang.getName());
+ }
+ return builder;
+ }
+
private static List<Issues.Component> formatComponents(SearchResponseData data) {
Collection<ComponentDto> components = data.getComponents();
List<Issues.Component> result = new ArrayList<>();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java b/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java
index aec99251571..3083e4e34e1 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/ui/ws/ComponentAction.java
@@ -62,6 +62,7 @@ import org.sonar.server.qualityprofile.QPMeasureData;
import org.sonar.server.qualityprofile.QualityProfile;
import org.sonar.server.ui.PageRepository;
import org.sonar.server.user.UserSession;
+import org.sonar.server.ws.WsUtils;
import static java.lang.String.format;
import static java.util.Collections.emptySortedSet;
@@ -76,10 +77,10 @@ import static org.sonar.server.user.AbstractUserSession.insufficientPrivilegesEx
import static org.sonar.server.ws.KeyExamples.KEY_BRANCH_EXAMPLE_001;
import static org.sonar.server.ws.KeyExamples.KEY_PROJECT_EXAMPLE_001;
import static org.sonar.server.ws.KeyExamples.KEY_PULL_REQUEST_EXAMPLE_001;
-import static org.sonar.server.ws.WsUtils.checkComponentNotAModuleAndNotADirectory;
public class ComponentAction implements NavigationWsAction {
+ private static final Set<String> MODULE_OR_DIR_QUALIFIERS = ImmutableSet.of(Qualifiers.MODULE, Qualifiers.DIRECTORY);
static final String PARAM_COMPONENT = "component";
private static final String PARAM_BRANCH = "branch";
private static final String PARAM_PULL_REQUEST = "pullRequest";
@@ -177,6 +178,10 @@ public class ComponentAction implements NavigationWsAction {
}
}
+ private static void checkComponentNotAModuleAndNotADirectory(ComponentDto component) {
+ WsUtils.checkRequest(!MODULE_OR_DIR_QUALIFIERS.contains(component.qualifier()), "Operation not supported for module or directory components");
+ }
+
private ComponentDto getRootProjectOrBranch(ComponentDto component, DbSession session) {
if (!component.isRootProject()) {
return dbClient.componentDao().selectOrFailByUuid(session, component.projectUuid());
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/DeprecatedPropertiesWsFilter.java b/server/sonar-server/src/main/java/org/sonar/server/ws/DeprecatedPropertiesWsFilter.java
index 95a09bc4925..7d67c785764 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/DeprecatedPropertiesWsFilter.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/ws/DeprecatedPropertiesWsFilter.java
@@ -37,15 +37,11 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.sonar.api.web.ServletFilter;
import org.sonar.server.property.ws.IndexAction;
+import org.sonar.server.setting.ws.SettingsWsParameters;
import static com.google.common.base.Strings.isNullOrEmpty;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.sonar.server.property.ws.PropertiesWs.CONTROLLER_PROPERTIES;
-import static org.sonar.server.setting.ws.SettingsWsParameters.PARAM_COMPONENT;
-import static org.sonar.server.setting.ws.SettingsWsParameters.PARAM_KEY;
-import static org.sonar.server.setting.ws.SettingsWsParameters.PARAM_KEYS;
-import static org.sonar.server.setting.ws.SettingsWsParameters.PARAM_VALUE;
-import static org.sonar.server.setting.ws.SettingsWsParameters.PARAM_VALUES;
/**
* This filter is used to execute deprecated api/properties WS, that were using REST
@@ -107,12 +103,12 @@ public class DeprecatedPropertiesWsFilter extends ServletFilter {
}
@Override
- protected String readParam(String key) {
+ public String readParam(String key) {
return restResponse.additionalParams.get(key);
}
@Override
- protected List<String> readMultiParam(String key) {
+ public List<String> readMultiParam(String key) {
return new ArrayList<>(restResponse.additionalMultiParams.get(key));
}
@@ -219,20 +215,20 @@ public class DeprecatedPropertiesWsFilter extends ServletFilter {
}
private void redirectToSet(Optional<String> key, List<String> values, Optional<String> component) {
- addParameterIfPresent(PARAM_KEY, key);
+ addParameterIfPresent(SettingsWsParameters.PARAM_KEY, key);
if (values.size() == 1) {
- additionalParams.put(PARAM_VALUE, values.get(0));
+ additionalParams.put(SettingsWsParameters.PARAM_VALUE, values.get(0));
} else {
- additionalMultiParams.putAll(PARAM_VALUES, values);
+ additionalMultiParams.putAll(SettingsWsParameters.PARAM_VALUES, values);
}
- addParameterIfPresent(PARAM_COMPONENT, component);
+ addParameterIfPresent(SettingsWsParameters.PARAM_COMPONENT, component);
redirectedPath = "api/settings/set";
redirectedMethod = "POST";
}
private void redirectToReset(Optional<String> key, Optional<String> component) {
- addParameterIfPresent(PARAM_KEYS, key);
- addParameterIfPresent(PARAM_COMPONENT, component);
+ addParameterIfPresent(SettingsWsParameters.PARAM_KEYS, key);
+ addParameterIfPresent(SettingsWsParameters.PARAM_COMPONENT, component);
redirectedPath = "api/settings/reset";
redirectedMethod = "POST";
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceFilter.java b/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceFilter.java
index b9856283552..ebd1b3aefca 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceFilter.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceFilter.java
@@ -30,9 +30,9 @@ import org.sonar.api.SonarRuntime;
import org.sonar.api.server.ws.WebService;
import org.sonar.api.web.ServletFilter;
import org.sonar.core.util.stream.MoreCollectors;
+import org.sonar.server.property.ws.PropertiesWs;
import static java.util.stream.Stream.concat;
-import static org.sonar.server.property.ws.PropertiesWs.CONTROLLER_PROPERTIES;
import static org.sonar.server.ws.WebServiceReroutingFilter.MOVED_WEB_SERVICES;
/**
@@ -60,7 +60,7 @@ public class WebServiceFilter extends ServletFilter {
.map(toPath()))
.collect(MoreCollectors.toSet());
this.excludeUrls = concat(concat(
- Stream.of("/" + CONTROLLER_PROPERTIES + "*"),
+ Stream.of("/" + PropertiesWs.CONTROLLER_PROPERTIES + "*"),
MOVED_WEB_SERVICES.stream()),
webServiceEngine.controllers().stream()
.flatMap(controller -> controller.actions().stream())
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WsResponseCommonFormat.java b/server/sonar-server/src/main/java/org/sonar/server/ws/WsResponseCommonFormat.java
deleted file mode 100644
index 3167e90909c..00000000000
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/WsResponseCommonFormat.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2019 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.sonar.server.ws;
-
-import org.sonar.api.resources.Language;
-import org.sonar.api.resources.Languages;
-import org.sonar.api.utils.Paging;
-import org.sonar.db.rule.RuleDefinitionDto;
-import org.sonarqube.ws.Common;
-
-import static com.google.common.base.Strings.nullToEmpty;
-
-public class WsResponseCommonFormat {
-
- private final Languages languages;
-
- public WsResponseCommonFormat(Languages languages) {
- this.languages = languages;
- }
-
- public Common.Paging.Builder formatPaging(Paging paging) {
- return Common.Paging.newBuilder()
- .setPageIndex(paging.pageIndex())
- .setPageSize(paging.pageSize())
- .setTotal(paging.total());
- }
-
- public Common.Rule.Builder formatRule(RuleDefinitionDto rule) {
- Common.Rule.Builder builder = Common.Rule.newBuilder()
- .setKey(rule.getKey().toString())
- .setName(nullToEmpty(rule.getName()))
- .setStatus(Common.RuleStatus.valueOf(rule.getStatus().name()));
-
- builder.setLang(nullToEmpty(rule.getLanguage()));
- Language lang = languages.get(rule.getLanguage());
- if (lang != null) {
- builder.setLangName(lang.getName());
- }
- return builder;
- }
-
-}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/package-info.java b/server/sonar-server/src/main/java/org/sonar/server/ws/package-info.java
index 464c533bab7..d4209ca34a5 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/package-info.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/ws/package-info.java
@@ -21,3 +21,4 @@
package org.sonar.server.ws;
import javax.annotation.ParametersAreNonnullByDefault;
+
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 7a44fea9f37..b9c68da85d3 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
@@ -30,7 +30,7 @@ public class IssueWsModuleTest {
public void verify_count_of_added_components() {
ComponentContainer container = new ComponentContainer();
new IssueWsModule().configure(container);
- assertThat(container.size()).isEqualTo(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 31);
+ assertThat(container.size()).isEqualTo(COMPONENTS_IN_EMPTY_COMPONENT_CONTAINER + 30);
}
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsTest.java
index 9a4bacc317d..1dd9477158e 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionComponentsTest.java
@@ -51,7 +51,6 @@ import org.sonar.server.permission.index.WebAuthorizationTypeSupport;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.view.index.ViewIndexer;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.server.ws.WsResponseCommonFormat;
import org.sonarqube.ws.Issues;
import org.sonarqube.ws.Issues.Component;
import org.sonarqube.ws.Issues.Issue;
@@ -105,7 +104,7 @@ public class SearchActionComponentsTest {
private IssueWorkflow issueWorkflow = new IssueWorkflow(new FunctionExecutor(issueFieldsSetter), issueFieldsSetter);
private SearchResponseLoader searchResponseLoader = new SearchResponseLoader(userSession, dbClient, new TransitionService(userSession, issueWorkflow));
private Languages languages = new Languages();
- private SearchResponseFormat searchResponseFormat = new SearchResponseFormat(new Durations(), new WsResponseCommonFormat(languages), languages, new AvatarResolverImpl());
+ private SearchResponseFormat searchResponseFormat = new SearchResponseFormat(new Durations(), languages, new AvatarResolverImpl());
private PermissionIndexerTester permissionIndexer = new PermissionIndexerTester(es, issueIndexer);
private WsActionTester ws = new WsActionTester(new SearchAction(userSession, issueIndex, issueQueryFactory, searchResponseLoader, searchResponseFormat,
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionFacetsTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionFacetsTest.java
index 1d5d65750a9..3a1c6530e73 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionFacetsTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionFacetsTest.java
@@ -48,7 +48,6 @@ import org.sonar.server.permission.index.PermissionIndexer;
import org.sonar.server.permission.index.WebAuthorizationTypeSupport;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.server.ws.WsResponseCommonFormat;
import org.sonarqube.ws.Common;
import org.sonarqube.ws.Common.FacetValue;
import org.sonarqube.ws.Issues.SearchWsResponse;
@@ -87,7 +86,7 @@ public class SearchActionFacetsTest {
private IssueQueryFactory issueQueryFactory = new IssueQueryFactory(db.getDbClient(), Clock.systemUTC(), userSession);
private SearchResponseLoader searchResponseLoader = new SearchResponseLoader(userSession, db.getDbClient(), new TransitionService(userSession, null));
private Languages languages = new Languages();
- private SearchResponseFormat searchResponseFormat = new SearchResponseFormat(new Durations(), new WsResponseCommonFormat(languages), languages, new AvatarResolverImpl());
+ private SearchResponseFormat searchResponseFormat = new SearchResponseFormat(new Durations(), languages, new AvatarResolverImpl());
private WsActionTester ws = new WsActionTester(
new SearchAction(userSession, issueIndex, issueQueryFactory, searchResponseLoader, searchResponseFormat,
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java
index 2c6fc63e0db..f3768030a5e 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java
@@ -68,7 +68,6 @@ import org.sonar.server.permission.index.WebAuthorizationTypeSupport;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.TestResponse;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.server.ws.WsResponseCommonFormat;
import org.sonarqube.ws.Common;
import org.sonarqube.ws.Common.Severity;
import org.sonarqube.ws.Issues;
@@ -99,8 +98,6 @@ import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_ADDITIONAL_
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_COMPONENT_KEYS;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_CREATED_AFTER;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_HIDE_COMMENTS;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PAGE_INDEX;
-import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_PAGE_SIZE;
import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_RULES;
public class SearchActionTest {
@@ -123,7 +120,7 @@ public class SearchActionTest {
private IssueWorkflow issueWorkflow = new IssueWorkflow(new FunctionExecutor(issueFieldsSetter), issueFieldsSetter);
private SearchResponseLoader searchResponseLoader = new SearchResponseLoader(userSession, dbClient, new TransitionService(userSession, issueWorkflow));
private Languages languages = new Languages();
- private SearchResponseFormat searchResponseFormat = new SearchResponseFormat(new Durations(), new WsResponseCommonFormat(languages), languages, new AvatarResolverImpl());
+ private SearchResponseFormat searchResponseFormat = new SearchResponseFormat(new Durations(), languages, new AvatarResolverImpl());
private WsActionTester ws = new WsActionTester(new SearchAction(userSession, issueIndex, issueQueryFactory, searchResponseLoader, searchResponseFormat,
new MapSettings().asConfig(), System2.INSTANCE, dbClient));
private StartupIndexer permissionIndexer = new PermissionIndexer(dbClient, es.client(), issueIndexer);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTestOnSonarCloud.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTestOnSonarCloud.java
index b029c512d7e..6b1aef9fd63 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTestOnSonarCloud.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTestOnSonarCloud.java
@@ -50,7 +50,6 @@ import org.sonar.server.permission.index.PermissionIndexerTester;
import org.sonar.server.permission.index.WebAuthorizationTypeSupport;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.server.ws.WsResponseCommonFormat;
import org.sonar.test.JsonAssert;
import static org.assertj.core.api.Assertions.assertThat;
@@ -77,7 +76,7 @@ public class SearchActionTestOnSonarCloud {
private IssueWorkflow issueWorkflow = new IssueWorkflow(new FunctionExecutor(issueFieldsSetter), issueFieldsSetter);
private SearchResponseLoader searchResponseLoader = new SearchResponseLoader(userSession, dbClient, new TransitionService(userSession, issueWorkflow));
private Languages languages = new Languages();
- private SearchResponseFormat searchResponseFormat = new SearchResponseFormat(new Durations(), new WsResponseCommonFormat(languages), languages, new AvatarResolverImpl());
+ private SearchResponseFormat searchResponseFormat = new SearchResponseFormat(new Durations(), languages, new AvatarResolverImpl());
private PermissionIndexerTester permissionIndexer = new PermissionIndexerTester(es, issueIndexer);
private SearchAction underTest = new SearchAction(userSession, issueIndex, issueQueryFactory, searchResponseLoader, searchResponseFormat,
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/DeprecatedPropertiesWsFilterTest.java b/server/sonar-server/src/test/java/org/sonar/server/ws/DeprecatedPropertiesWsFilterTest.java
index 848eb6eca16..753f4ae0bc3 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/DeprecatedPropertiesWsFilterTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/ws/DeprecatedPropertiesWsFilterTest.java
@@ -20,7 +20,6 @@
package org.sonar.server.ws;
import java.io.ByteArrayInputStream;
-import java.io.IOException;
import java.util.Arrays;
import javax.servlet.FilterChain;
import javax.servlet.ReadListener;
@@ -250,7 +249,7 @@ public class DeprecatedPropertiesWsFilterTest {
}
@Test
- public void redirect_delete_api_properties_to_api_settings_reset() throws Exception {
+ public void redirect_delete_api_properties_to_api_settings_reset() {
when(request.getRequestURI()).thenReturn("/api/properties/my.property");
when(request.getParameter("resource")).thenReturn("my_project");
when(request.getMethod()).thenReturn("DELETE");
diff --git a/server/sonar-webserver-ws/build.gradle b/server/sonar-webserver-ws/build.gradle
new file mode 100644
index 00000000000..69988d0f19c
--- /dev/null
+++ b/server/sonar-webserver-ws/build.gradle
@@ -0,0 +1,42 @@
+description = 'WebServer "API" to write Web Services'
+
+sonarqube {
+ properties {
+ property 'sonar.projectName', "${projectTitle} :: WebServer :: WS"
+ }
+}
+
+configurations {
+ tests
+
+ testCompile.extendsFrom tests
+}
+
+dependencies {
+ // please keep the list grouped by configuration and ordered by name
+
+ compile 'com.google.guava:guava'
+ compile project(':sonar-core')
+ compile project(path: ':sonar-plugin-api', configuration: 'shadow')
+ compile project(':sonar-plugin-api-impl')
+ compile project(':sonar-ws')
+
+ compileOnly 'com.google.code.findbugs:jsr305'
+ compileOnly 'javax.servlet:javax.servlet-api'
+ compileOnly 'org.apache.tomcat.embed:tomcat-embed-core'
+
+ testCompile 'com.google.code.findbugs:jsr305'
+ testCompile 'javax.servlet:javax.servlet-api'
+ testCompile 'org.apache.tomcat.embed:tomcat-embed-core'
+ testCompile 'org.mockito:mockito-core'
+ testCompile project(':sonar-testing-harness')
+}
+
+task testJar(type: Jar) {
+ classifier = 'tests'
+ from sourceSets.test.output
+}
+
+artifacts {
+ tests testJar
+}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/BadRequestException.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/BadRequestException.java
index 7a2fdf7166d..7a2fdf7166d 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/BadRequestException.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/BadRequestException.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/ForbiddenException.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/ForbiddenException.java
index d72eefbd02f..d72eefbd02f 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/ForbiddenException.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/ForbiddenException.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/Message.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/Message.java
index c069ead73d2..c069ead73d2 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/Message.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/Message.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/NotFoundException.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/NotFoundException.java
index ff5fb2f13c4..ff5fb2f13c4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/NotFoundException.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/NotFoundException.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/ServerException.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/ServerException.java
index 491c17ed437..491c17ed437 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/ServerException.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/ServerException.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/UnauthorizedException.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/UnauthorizedException.java
index 0b4af12beee..0b4af12beee 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/UnauthorizedException.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/UnauthorizedException.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/package-info.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/package-info.java
index c1ac144f25a..c1ac144f25a 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/package-info.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/exceptions/package-info.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/CacheWriter.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/CacheWriter.java
index 75ffb3a6449..75ffb3a6449 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/CacheWriter.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/CacheWriter.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/DefaultLocalResponse.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/DefaultLocalResponse.java
index 07c11840a16..07c11840a16 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/DefaultLocalResponse.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/DefaultLocalResponse.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/JsonWriterUtils.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/JsonWriterUtils.java
index dec4bbc67c4..dec4bbc67c4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/JsonWriterUtils.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/JsonWriterUtils.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/KeyExamples.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/KeyExamples.java
index ef8773deec0..ef8773deec0 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/KeyExamples.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/KeyExamples.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/LocalRequestAdapter.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/LocalRequestAdapter.java
index 849ce475240..849ce475240 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/LocalRequestAdapter.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/LocalRequestAdapter.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/RemovedWebServiceHandler.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/RemovedWebServiceHandler.java
index 1b2f608ecd8..1b2f608ecd8 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/RemovedWebServiceHandler.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/RemovedWebServiceHandler.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/RequestVerifier.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/RequestVerifier.java
index c5e86345593..c5e86345593 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/RequestVerifier.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/RequestVerifier.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/ServletFilterHandler.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletFilterHandler.java
index 7ae51e2241b..7ae51e2241b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/ServletFilterHandler.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletFilterHandler.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/ServletRequest.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletRequest.java
index 966e0422315..1f473a9011b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/ServletRequest.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletRequest.java
@@ -84,7 +84,7 @@ public class ServletRequest extends ValidatingRequest {
}
@Override
- protected String readParam(String key) {
+ public String readParam(String key) {
return source.getParameter(key);
}
@@ -94,7 +94,7 @@ public class ServletRequest extends ValidatingRequest {
}
@Override
- protected List<String> readMultiParam(String key) {
+ public List<String> readMultiParam(String key) {
String[] values = source.getParameterValues(key);
return values == null ? emptyList() : ImmutableList.copyOf(values);
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/ServletResponse.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletResponse.java
index 2f385b89bcd..2f385b89bcd 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/ServletResponse.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/ServletResponse.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WebServiceEngine.java
index e7569e60350..e7569e60350 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/WebServiceEngine.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WebServiceEngine.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WsAction.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WsAction.java
index bb7ed1932d6..bb7ed1932d6 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/WsAction.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WsAction.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WsParameterBuilder.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WsParameterBuilder.java
index 291d9af0a5b..291d9af0a5b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/WsParameterBuilder.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WsParameterBuilder.java
diff --git a/server/sonar-server/src/main/java/org/sonar/server/ws/WsUtils.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WsUtils.java
index 9c144754ba3..2f936764f7d 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/ws/WsUtils.java
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/WsUtils.java
@@ -33,7 +33,6 @@ import org.sonar.api.server.ws.Request;
import org.sonar.api.server.ws.Response;
import org.sonar.api.utils.text.JsonWriter;
import org.sonar.core.util.ProtobufJsonFormat;
-import org.sonar.db.component.ComponentDto;
import org.sonar.server.exceptions.BadRequestException;
import org.sonar.server.exceptions.NotFoundException;
@@ -44,8 +43,6 @@ import static org.sonarqube.ws.MediaTypes.PROTOBUF;
public class WsUtils {
- private static final Set<String> MODULE_OR_DIR_QUALIFIERS = ImmutableSet.of(Qualifiers.MODULE, Qualifiers.DIRECTORY);
-
private WsUtils() {
// only statics
}
@@ -123,8 +120,4 @@ public class WsUtils {
return value.get();
}
-
- public static void checkComponentNotAModuleAndNotADirectory(ComponentDto component) {
- checkRequest(!MODULE_OR_DIR_QUALIFIERS.contains(component.qualifier()), "Operation not supported for module or directory components");
- }
}
diff --git a/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/package-info.java b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/package-info.java
new file mode 100644
index 00000000000..464c533bab7
--- /dev/null
+++ b/server/sonar-webserver-ws/src/main/java/org/sonar/server/ws/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 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.sonar.server.ws;
+
+import javax.annotation.ParametersAreNonnullByDefault;
diff --git a/server/sonar-server/src/main/resources/org/sonar/server/ws/removed-ws-example.json b/server/sonar-webserver-ws/src/main/resources/org/sonar/server/ws/removed-ws-example.json
index 6764a133ed3..6764a133ed3 100644
--- a/server/sonar-server/src/main/resources/org/sonar/server/ws/removed-ws-example.json
+++ b/server/sonar-webserver-ws/src/main/resources/org/sonar/server/ws/removed-ws-example.json
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/CacheWriterTest.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/CacheWriterTest.java
index 355d4762432..355d4762432 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/CacheWriterTest.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/CacheWriterTest.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/DumbResponse.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/DumbResponse.java
index f7d2aeedd80..f7d2aeedd80 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/DumbResponse.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/DumbResponse.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/RemovedWebServiceHandlerTest.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/RemovedWebServiceHandlerTest.java
index 262a8325845..262a8325845 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/RemovedWebServiceHandlerTest.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/RemovedWebServiceHandlerTest.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/ServletRequestTest.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/ServletRequestTest.java
index 502dfa9dec7..502dfa9dec7 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/ServletRequestTest.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/ServletRequestTest.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/ServletResponseTest.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/ServletResponseTest.java
index aa4cda9ca7b..aa4cda9ca7b 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/ServletResponseTest.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/ServletResponseTest.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/TestRequest.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestRequest.java
index aea0e0d69bd..aea0e0d69bd 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/TestRequest.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestRequest.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/TestResponse.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestResponse.java
index 82057f06af0..82057f06af0 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/TestResponse.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/TestResponse.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
index 160fce7540f..160fce7540f 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/WsActionTester.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsActionTester.java
index fede932156e..fede932156e 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/WsActionTester.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsActionTester.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/WsTester.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsTester.java
index e69153b5033..e69153b5033 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/WsTester.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsTester.java
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/WsUtilsTest.java b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsUtilsTest.java
index 5bbd1a9a891..5bbd1a9a891 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/WsUtilsTest.java
+++ b/server/sonar-webserver-ws/src/test/java/org/sonar/server/ws/WsUtilsTest.java
diff --git a/server/sonar-webserver-ws/src/test/resources/logback-test.xml b/server/sonar-webserver-ws/src/test/resources/logback-test.xml
new file mode 100644
index 00000000000..3e34b0f9fc8
--- /dev/null
+++ b/server/sonar-webserver-ws/src/test/resources/logback-test.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<configuration debug="false">
+ <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
+
+ <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+ <pattern>
+ %d{yyyy.MM.dd HH:mm:ss} %-5level %msg%n
+ </pattern>
+ </encoder>
+ </appender>
+
+ <root>
+ <level value="INFO"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+ <logger name="ch.qos.logback">
+ <level value="WARN"/>
+ </logger>
+
+ <logger name="okhttp3.mockwebserver">
+ <level value="WARN"/>
+ </logger>
+
+</configuration>
diff --git a/settings.gradle b/settings.gradle
index 669cd2dde6b..45401a90444 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -17,6 +17,7 @@ include 'server:sonar-server'
include 'server:sonar-server-common'
include 'server:sonar-vsts'
include 'server:sonar-web'
+include 'server:sonar-webserver-ws'
include 'sonar-application'
include 'sonar-check-api'