diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2019-12-09 09:34:43 -0600 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-12-10 20:46:09 +0100 |
commit | d1fd889554bccbb50122550899dbb66b90b04f78 (patch) | |
tree | 9cad838366292ee79b77ac3513403f7489b06355 /server/sonar-webserver-ws/src/testFixtures | |
parent | f86a1094588e4e47b3abf612891af0431653cd0e (diff) | |
download | sonarqube-d1fd889554bccbb50122550899dbb66b90b04f78.tar.gz sonarqube-d1fd889554bccbb50122550899dbb66b90b04f78.zip |
Fix code quality issues and reduce dependency on Guava
Diffstat (limited to 'server/sonar-webserver-ws/src/testFixtures')
-rw-r--r-- | server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/DumbResponse.java | 6 | ||||
-rw-r--r-- | server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/TestRequest.java | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/DumbResponse.java b/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/DumbResponse.java index f7d2aeedd80..8ff41e5080a 100644 --- a/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/DumbResponse.java +++ b/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/DumbResponse.java @@ -20,7 +20,6 @@ package org.sonar.server.ws; import com.google.common.base.Throwables; -import com.google.common.collect.Maps; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; @@ -28,6 +27,7 @@ import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.nio.charset.StandardCharsets; import java.util.Collection; +import java.util.HashMap; import java.util.Map; import javax.annotation.CheckForNull; import org.apache.commons.io.IOUtils; @@ -40,7 +40,7 @@ public class DumbResponse implements Response { private final ByteArrayOutputStream output = new ByteArrayOutputStream(); - private Map<String, String> headers = Maps.newHashMap(); + private Map<String, String> headers = new HashMap<>(); public class InMemoryStream implements Response.Stream { private String mediaType; @@ -118,7 +118,7 @@ public class DumbResponse implements Response { } @CheckForNull - public String getHeader(String name){ + public String getHeader(String name) { return headers.get(name); } diff --git a/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/TestRequest.java b/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/TestRequest.java index aea0e0d69bd..9992319c361 100644 --- a/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/TestRequest.java +++ b/server/sonar-webserver-ws/src/testFixtures/java/org/sonar/server/ws/TestRequest.java @@ -23,7 +23,6 @@ import com.google.common.base.Throwables; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ListMultimap; -import com.google.common.collect.Maps; import com.google.protobuf.GeneratedMessageV3; import java.io.BufferedReader; import java.io.InputStream; @@ -47,7 +46,7 @@ public class TestRequest extends ValidatingRequest { private final ListMultimap<String, String> multiParams = ArrayListMultimap.create(); private final Map<String, String> params = new HashMap<>(); private final Map<String, String> headers = new HashMap<>(); - private final Map<String, Part> parts = Maps.newHashMap(); + private final Map<String, Part> parts = new HashMap<>(); private String payload = ""; private boolean payloadConsumed = false; private String method = "GET"; |