RateLimiter fix (#2229)
This commit is contained in:
parent
647455b029
commit
c598b937f0
@ -3,11 +3,11 @@ package org.baeldung.guava;
|
|||||||
public class CustomEvent {
|
public class CustomEvent {
|
||||||
private String action;
|
private String action;
|
||||||
|
|
||||||
public CustomEvent(String action) {
|
CustomEvent(String action) {
|
||||||
this.action = action;
|
this.action = action;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAction() {
|
String getAction() {
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@ public class EventListener {
|
|||||||
eventsHandled++;
|
eventsHandled++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getEventsHandled() {
|
int getEventsHandled() {
|
||||||
return eventsHandled;
|
return eventsHandled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetEventsHandled() {
|
void resetEventsHandled() {
|
||||||
eventsHandled = 0;
|
eventsHandled = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import java.util.stream.IntStream;
|
|||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
public class RateLimiterUnitTest {
|
public class RateLimiterLongRunningUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenLimitedResource_whenUseRateLimiter_thenShouldLimitPermits() {
|
public void givenLimitedResource_whenUseRateLimiter_thenShouldLimitPermits() {
|
Loading…
x
Reference in New Issue
Block a user