From 4a5be9fbaba0b9729e909eec935852c56f6e71e2 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 10 Jan 2018 20:42:03 +0100 Subject: Upgrade Mockito from 1.10.19 to 2.13.0 --- .../sonar/core/util/DefaultHttpDownloaderTest.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'sonar-core') 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() { - @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"); })); } -- cgit v1.2.3