Skip to content

Commit e9a219f

Browse files
Merge branch 'master' of https://github.com/Argyro-Sioziou/java-design-patterns into acyclic-visitor
2 parents 8bf53fe + c713dbc commit e9a219f

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

throttling/src/test/java/com/iluwatar/throttling/B2BServiceTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,27 @@
2222
*/
2323
package com.iluwatar.throttling;
2424

25-
import com.iluwatar.throttling.timer.ThrottleTimerImpl;
2625
import com.iluwatar.throttling.timer.Throttler;
27-
import org.junit.jupiter.api.Disabled;
2826
import org.junit.jupiter.api.Test;
2927

30-
import static org.junit.jupiter.api.Assertions.assertTrue;
28+
import static org.junit.jupiter.api.Assertions.assertEquals;
3129

3230
/**
3331
* B2BServiceTest class to test the B2BService
3432
*/
3533
public class B2BServiceTest {
3634

37-
@Disabled
3835
@Test
3936
public void dummyCustomerApiTest() {
4037
Tenant tenant = new Tenant("testTenant", 2);
41-
Throttler timer = new ThrottleTimerImpl(100);
38+
// In order to assure that throttling limits will not be reset, we use an empty throttling implementation
39+
Throttler timer = () -> { };
4240
B2BService service = new B2BService(timer);
4341

4442
for (int i = 0; i < 5; i++) {
4543
service.dummyCustomerApi(tenant);
4644
}
4745
long counter = CallsCount.getCount(tenant.getName());
48-
assertTrue(counter == 2, "Counter limit must be reached");
46+
assertEquals(2, counter, "Counter limit must be reached");
4947
}
5048
}

0 commit comments

Comments
 (0)