aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2018-01-10 20:42:03 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2018-01-14 20:37:37 +0100
commit4a5be9fbaba0b9729e909eec935852c56f6e71e2 (patch)
treef6f73398d587abf3c2dd460bb9a8813a99b95fc6 /sonar-core
parent93c6c4ccda2bf18fc651b215576172810a1f8725 (diff)
downloadsonarqube-4a5be9fbaba0b9729e909eec935852c56f6e71e2.tar.gz
sonarqube-4a5be9fbaba0b9729e909eec935852c56f6e71e2.zip
Upgrade Mockito from 1.10.19 to 2.13.0
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/test/java/org/sonar/core/util/DefaultHttpDownloaderTest.java19
1 files changed, 5 insertions, 14 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/util/DefaultHttpDownloaderTest.java b/sonar-core/src/test/java/org/sonar/core/util/DefaultHttpDownloaderTest.java
index edf673b6e24..ecb23275f2e 100644
--- a/sonar-core/src/test/java/org/sonar/core/util/DefaultHttpDownloaderTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/util/DefaultHttpDownloaderTest.java
@@ -22,7 +22,6 @@ package org.sonar.core.util;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.net.Authenticator;
import java.net.InetSocketAddress;
import java.net.NoRouteToHostException;
import java.net.PasswordAuthentication;
@@ -39,7 +38,6 @@ import java.util.Properties;
import java.util.zip.GZIPOutputStream;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
-import org.hamcrest.TypeSafeMatcher;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Rule;
@@ -295,18 +293,11 @@ public class DefaultHttpDownloaderTest {
new DefaultHttpDownloader.BaseHttpDownloader(system, settings.asConfig(), null);
- verify(system).setDefaultAuthenticator(argThat(new TypeSafeMatcher<Authenticator>() {
- @Override
- protected boolean matchesSafely(Authenticator authenticator) {
- DefaultHttpDownloader.ProxyAuthenticator a = (DefaultHttpDownloader.ProxyAuthenticator) authenticator;
- PasswordAuthentication authentication = a.getPasswordAuthentication();
- return authentication.getUserName().equals("the_login") &&
- new String(authentication.getPassword()).equals("the_passwd");
- }
-
- @Override
- public void describeTo(Description description) {
- }
+ verify(system).setDefaultAuthenticator(argThat(authenticator -> {
+ DefaultHttpDownloader.ProxyAuthenticator a = (DefaultHttpDownloader.ProxyAuthenticator) authenticator;
+ PasswordAuthentication authentication = a.getPasswordAuthentication();
+ return authentication.getUserName().equals("the_login") &&
+ new String(authentication.getPassword()).equals("the_passwd");
}));
}