aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWojtek Wajerowicz <115081248+wojciech-wajerowicz-sonarsource@users.noreply.github.com>2024-01-23 10:37:50 +0100
committersonartech <sonartech@sonarsource.com>2024-01-23 20:04:15 +0000
commit29f0fde0bf04408dd3c35d5122bacda8289e6926 (patch)
tree4d41899ccd672491dc56dd51f885ea4fd904b051
parentfaed1a199b6f8491508d254b4cf3accf1a499792 (diff)
downloadsonarqube-29f0fde0bf04408dd3c35d5122bacda8289e6926.tar.gz
sonarqube-29f0fde0bf04408dd3c35d5122bacda8289e6926.zip
SONAR-20451 Extend reset time in RatioBasedRateLimitCheckerTest.
-rw-r--r--server/sonar-alm-client/src/test/java/org/sonar/alm/client/RatioBasedRateLimitCheckerTest.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/sonar-alm-client/src/test/java/org/sonar/alm/client/RatioBasedRateLimitCheckerTest.java b/server/sonar-alm-client/src/test/java/org/sonar/alm/client/RatioBasedRateLimitCheckerTest.java
index 39a85ff31de..b7d1b2aee8d 100644
--- a/server/sonar-alm-client/src/test/java/org/sonar/alm/client/RatioBasedRateLimitCheckerTest.java
+++ b/server/sonar-alm-client/src/test/java/org/sonar/alm/client/RatioBasedRateLimitCheckerTest.java
@@ -40,6 +40,7 @@ public class RatioBasedRateLimitCheckerTest {
@Rule
public LogTester logTester = new LogTester();
private static final long MILLIS_BEFORE_RESET = 100L;
+ public static final int TIME_UNTIL_RESET = 2;
RatioBasedRateLimitChecker ratioBasedRateLimitChecker = new RatioBasedRateLimitChecker();
@DataProvider
@@ -62,7 +63,7 @@ public class RatioBasedRateLimitCheckerTest {
ApplicationHttpClient.RateLimit record = mock();
when(record.limit()).thenReturn(limit);
when(record.remaining()).thenReturn(remaining);
- when(record.reset()).thenReturn(System.currentTimeMillis() / 1000 + 1);
+ when(record.reset()).thenReturn(System.currentTimeMillis() / 1000 + TIME_UNTIL_RESET);
long start = System.currentTimeMillis();
boolean result = ratioBasedRateLimitChecker.checkRateLimit(record);