diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-10-03 14:45:36 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-10-03 14:49:38 +0200 |
commit | 84828a88e063c70deb4f4a8201b5a18f7334c6b2 (patch) | |
tree | 13add103329726b4253c5631469471b8bcb3440a /sonar-ws | |
parent | 737454ef4285f3f28578cad422900f3448e6a512 (diff) | |
download | sonarqube-84828a88e063c70deb4f4a8201b5a18f7334c6b2.tar.gz sonarqube-84828a88e063c70deb4f4a8201b5a18f7334c6b2.zip |
Fix build error with Maven 3.2.5
For unknown reasons HttpConnectorTest does not fail on Maven 3.3+
whereas a required dependency on commons-codec is missing.
Diffstat (limited to 'sonar-ws')
-rw-r--r-- | sonar-ws/src/test/java/org/sonarqube/ws/client/HttpConnectorTest.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/HttpConnectorTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/HttpConnectorTest.java index f4d0f2a7521..97d963d1be4 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/HttpConnectorTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/HttpConnectorTest.java @@ -23,6 +23,7 @@ import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; import java.net.Proxy; +import java.util.Base64; import java.util.List; import java.util.Random; import javax.net.ssl.SSLSocketFactory; @@ -30,7 +31,6 @@ import okhttp3.ConnectionSpec; import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; -import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.RandomStringUtils; @@ -185,7 +185,8 @@ public class HttpConnectorTest { RecordedRequest recordedRequest = server.takeRequest(); // do not use OkHttp Credentials.basic() in order to not use the same code as the code under test - String expectedHeader = "Basic " + Base64.encodeBase64String((login + ":" + password).getBytes(UTF_8)); + + String expectedHeader = "Basic " + Base64.getEncoder().encodeToString((login + ":" + password).getBytes(UTF_8)); assertThat(recordedRequest.getHeader("Authorization")).isEqualTo(expectedHeader); } |