diff options
author | Léo Geoffroy <99647462+leo-geoffroy-sonarsource@users.noreply.github.com> | 2022-04-04 18:08:34 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-04-04 20:02:56 +0000 |
commit | 12939729652fad6fa91b72c2139da65dc07ec7e0 (patch) | |
tree | 4752663c64fe527eabe2129028a22a1f394351cb /sonar-core/src/test/java | |
parent | 328aa8c538d17bb2c0f201de221e7edeff5e1349 (diff) | |
download | sonarqube-12939729652fad6fa91b72c2139da65dc07ec7e0.tar.gz sonarqube-12939729652fad6fa91b72c2139da65dc07ec7e0.zip |
NO-JIRA Update Mockito and simpleframework to latest major version
Diffstat (limited to 'sonar-core/src/test/java')
3 files changed, 8 insertions, 7 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/i18n/DurationLabelTest.java b/sonar-core/src/test/java/org/sonar/core/i18n/DurationLabelTest.java index a8700012609..e58ac066c36 100644 --- a/sonar-core/src/test/java/org/sonar/core/i18n/DurationLabelTest.java +++ b/sonar-core/src/test/java/org/sonar/core/i18n/DurationLabelTest.java @@ -21,7 +21,7 @@ package org.sonar.core.i18n; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import static org.assertj.core.api.Assertions.assertThat; diff --git a/sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java b/sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java index 5dd30052181..94d741b004b 100644 --- a/sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java +++ b/sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java @@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.startsWith; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.verifyNoInteractions; public class ComponentKeysTest { @@ -51,7 +51,7 @@ public class ComponentKeysTest { public void should_log_warning_if_toString_is_not_overridden() { Logger log = mock(Logger.class); keys.of(new Object(), log); - verifyZeroInteractions(log); + verifyNoInteractions(log); // only on non-first runs, to avoid false-positives on singletons keys.of(new Object(), log); 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 51f3b2158d1..e1dddd28b79 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 @@ -47,6 +47,7 @@ import org.junit.rules.Timeout; import org.simpleframework.http.Request; import org.simpleframework.http.Response; import org.simpleframework.http.core.Container; +import org.simpleframework.http.core.ContainerServer; import org.simpleframework.transport.connect.SocketConnection; import org.sonar.api.CoreProperties; import org.sonar.api.config.internal.MapSettings; @@ -75,12 +76,12 @@ public class DefaultHttpDownloaderTest { @BeforeClass public static void startServer() throws IOException { - socketConnection = new SocketConnection(new Container() { + socketConnection = new SocketConnection(new ContainerServer(new Container() { public void handle(Request req, Response resp) { try { if (req.getPath().getPath().contains("/redirect/")) { resp.setCode(303); - resp.add("Location", "/"); + resp.setValue("Location", "/"); } else { if (req.getPath().getPath().contains("/timeout/")) { try { @@ -93,7 +94,7 @@ public class DefaultHttpDownloaderTest { if (!"gzip".equals(req.getValue("Accept-Encoding"))) { throw new IllegalStateException("Should accept gzip"); } - resp.set("Content-Encoding", "gzip"); + resp.setValue("Content-Encoding", "gzip"); GZIPOutputStream gzipOutputStream = new GZIPOutputStream(resp.getOutputStream()); gzipOutputStream.write("GZIP response".getBytes()); gzipOutputStream.close(); @@ -110,7 +111,7 @@ public class DefaultHttpDownloaderTest { } } } - }); + })); SocketAddress address = socketConnection.connect(new InetSocketAddress("localhost", 0)); baseUrl = String.format("http://%s:%d", ((InetSocketAddress) address).getAddress().getHostAddress(), ((InetSocketAddress) address).getPort()); |