diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2018-01-10 20:42:03 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2018-01-14 20:37:37 +0100 |
commit | 4a5be9fbaba0b9729e909eec935852c56f6e71e2 (patch) | |
tree | f6f73398d587abf3c2dd460bb9a8813a99b95fc6 /sonar-core | |
parent | 93c6c4ccda2bf18fc651b215576172810a1f8725 (diff) | |
download | sonarqube-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.java | 19 |
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"); })); } |