diff options
-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); |