diff options
author | Wojtek Wajerowicz <115081248+wojciech-wajerowicz-sonarsource@users.noreply.github.com> | 2024-01-23 10:37:50 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-01-23 20:04:15 +0000 |
commit | 29f0fde0bf04408dd3c35d5122bacda8289e6926 (patch) | |
tree | 4d41899ccd672491dc56dd51f885ea4fd904b051 | |
parent | faed1a199b6f8491508d254b4cf3accf1a499792 (diff) | |
download | sonarqube-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.java | 3 |
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); |