aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2022-07-05 15:52:26 +0200
committersonartech <sonartech@sonarsource.com>2022-07-06 20:03:56 +0000
commit6354fe3096b07caf9eb017ab7b4e0565f6d303fc (patch)
tree593d31be7e2902f186e85d6d0a588288162a73fe /sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
parent6a401f73236a70f702b64646d8bdec7c5a90e15d (diff)
downloadsonarqube-6354fe3096b07caf9eb017ab7b4e0565f6d303fc.tar.gz
sonarqube-6354fe3096b07caf9eb017ab7b4e0565f6d303fc.zip
SONAR-16567 add an analysis warning when using a token expiring in less than 7 days.
Diffstat (limited to 'sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
index d2b7cd4840d..233028242bd 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
@@ -48,6 +48,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.sonar.api.config.internal.MapSettings;
+import org.sonar.api.notifications.AnalysisWarnings;
import org.sonar.scanner.bootstrap.ScannerPluginInstaller.InstalledPlugin;
import org.sonarqube.ws.client.HttpConnector;
import org.sonarqube.ws.client.WsClientFactories;
@@ -56,6 +57,7 @@ import static org.apache.commons.io.FileUtils.moveFile;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.ThrowableAssert.ThrowingCallable;
+import static org.mockito.Mockito.mock;
public class PluginFilesTest {
@@ -64,6 +66,8 @@ public class PluginFilesTest {
@Rule
public MockWebServer server = new MockWebServer();
+ private final AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);
+
private File userHome;
private PluginFiles underTest;
@@ -72,7 +76,7 @@ public class PluginFilesTest {
HttpConnector connector = HttpConnector.newBuilder().url(server.url("/").toString()).build();
GlobalAnalysisMode analysisMode = new GlobalAnalysisMode(new ScannerProperties(Collections.emptyMap()));
DefaultScannerWsClient wsClient = new DefaultScannerWsClient(WsClientFactories.getDefault().newClient(connector), false,
- analysisMode);
+ analysisMode, analysisWarnings);
userHome = temp.newFolder();
MapSettings settings = new MapSettings();