use of io.github.bucket4j.ConsumptionProbe in project bucket4j-spring-boot-starter by MarcGiffing.
the class ZuulRateLimitFilterTest method setup.
@Before
public void setup() {
consumptionProbe = Mockito.mock(ConsumptionProbe.class);
when(consumptionProbe.isConsumed()).thenReturn(true);
rateLimitCheck1 = mock(RateLimitCheck.class);
rateLimitCheck2 = mock(RateLimitCheck.class);
rateLimitCheck3 = mock(RateLimitCheck.class);
configuration = new FilterConfiguration();
configuration.setRateLimitChecks(Arrays.asList(rateLimitCheck1, rateLimitCheck2, rateLimitCheck3));
configuration.setUrl("url");
filter = new ZuulRateLimitFilter(configuration) {
@Override
protected RequestContext getCurrentRequestContext() {
return Mockito.mock(RequestContext.class);
}
};
}
Aggregations