aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/test/java/org/sonarqube/ws/client
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2019-03-28 09:48:33 +0100
committerSonarTech <sonartech@sonarsource.com>2019-04-01 20:21:05 +0200
commitcdc95cd948c5fd8ce2ee8615fb61ff91eefd8c0c (patch)
treeffb53c286afc288b67720ed7b6c6521528434a3c /sonar-ws/src/test/java/org/sonarqube/ws/client
parent6de7d6e73ce3a6253e4eea98fde59a8b959ca6e8 (diff)
downloadsonarqube-cdc95cd948c5fd8ce2ee8615fb61ff91eefd8c0c.tar.gz
sonarqube-cdc95cd948c5fd8ce2ee8615fb61ff91eefd8c0c.zip
SONAR-7685 Remove guava dependency from sonar-ws
Diffstat (limited to 'sonar-ws/src/test/java/org/sonarqube/ws/client')
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/BaseRequestTest.java8
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/LocalWsConnectorTest.java6
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java2
3 files changed, 7 insertions, 9 deletions
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/BaseRequestTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/BaseRequestTest.java
index e2f6891eb9f..e07dfbc1255 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/BaseRequestTest.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/BaseRequestTest.java
@@ -19,7 +19,6 @@
*/
package org.sonarqube.ws.client;
-import com.google.common.collect.ImmutableList;
import java.util.Arrays;
import java.util.List;
import org.assertj.core.data.MapEntry;
@@ -28,7 +27,6 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonarqube.ws.MediaTypes;
-import static com.google.common.collect.Lists.newArrayList;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
@@ -70,17 +68,17 @@ public class BaseRequestTest {
assertParameters(entry("keyB", "b"), entry("keyA", "a"));
assertMultiValueParameters(entry("keyB", singletonList("b")), entry("keyA", singletonList("a")));
- underTest.setParam("keyC", ImmutableList.of("c1", "c2", "c3"));
+ underTest.setParam("keyC", asList("c1", "c2", "c3"));
assertParameters(entry("keyB", "b"), entry("keyA", "a"), entry("keyC", "c1"));
assertMultiValueParameters(
entry("keyB", singletonList("b")),
entry("keyA", singletonList("a")),
- entry("keyC", ImmutableList.of("c1", "c2", "c3")));
+ entry("keyC", asList("c1", "c2", "c3")));
}
@Test
public void skip_null_value_in_multi_param() {
- underTest.setParam("key", newArrayList("v1", null, "", "v3"));
+ underTest.setParam("key", asList("v1", null, "", "v3"));
assertMultiValueParameters(entry("key", asList("v1", "", "v3")));
}
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/LocalWsConnectorTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/LocalWsConnectorTest.java
index a43f941e637..649d910339e 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/LocalWsConnectorTest.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/LocalWsConnectorTest.java
@@ -19,9 +19,9 @@
*/
package org.sonarqube.ws.client;
-import com.google.common.collect.ImmutableMap;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.io.IOUtils;
@@ -57,7 +57,9 @@ public class LocalWsConnectorTest {
WsResponse wsResponse = underTest.call(wsRequest);
- verifyRequested("POST", "api/issues/search", MediaTypes.JSON, ImmutableMap.of("foo", "bar"));
+ Map<String, String> expectedParams = new HashMap<>();
+ expectedParams.put("foo", "bar");
+ verifyRequested("POST", "api/issues/search", MediaTypes.JSON, expectedParams);
assertThat(wsResponse.code()).isEqualTo(400);
assertThat(wsResponse.content()).isEqualTo("{}");
assertThat(IOUtils.toString(wsResponse.contentReader())).isEqualTo("{}");
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java
index e32a4e1a405..4fbecc55ce1 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/ServiceTester.java
@@ -19,7 +19,6 @@
*/
package org.sonarqube.ws.client;
-import com.google.common.base.Joiner;
import com.google.protobuf.Parser;
import java.util.ArrayList;
import java.util.List;
@@ -89,7 +88,6 @@ import static org.mockito.Mockito.spy;
*
*/
public class ServiceTester<T extends BaseService> extends ExternalResource {
- private static final Joiner COMMA_JOINER = Joiner.on(",");
private final T underTest;
private final List<GetCall> getCalls = new ArrayList<>();