Browse Source

Fix RateLimitsTest

pull/6235/head
Viacheslav Klimov 4 years ago
parent
commit
de16eca0a5
  1. 16
      common/message/src/test/java/org/thingsboard/server/common/msg/tools/RateLimitsTest.java

16
common/message/src/test/java/org/thingsboard/server/common/msg/tools/RateLimitsTest.java

@ -26,11 +26,9 @@ public class RateLimitsTest {
@Test
public void testRateLimits_greedyRefill() {
for (int period = 1; period <= 5; period++) {
for (int capacity = 1; capacity <= 5; capacity++) {
testRateLimitWithGreedyRefill(capacity, period);
}
}
testRateLimitWithGreedyRefill(3, 10);
testRateLimitWithGreedyRefill(3, 3);
testRateLimitWithGreedyRefill(4, 2);
}
private void testRateLimitWithGreedyRefill(int capacity, int period) {
@ -56,11 +54,9 @@ public class RateLimitsTest {
@Test
public void testRateLimits_intervalRefill() {
for (int period = 1; period <= 3; period++) {
for (int capacity = 1; capacity <= 3; capacity++) {
testRateLimitWithIntervalRefill(capacity, period);
}
}
testRateLimitWithIntervalRefill(10, 5);
testRateLimitWithIntervalRefill(3, 3);
testRateLimitWithIntervalRefill(4, 2);
}
private void testRateLimitWithIntervalRefill(int capacity, int period) {

Loading…
Cancel
Save