File tree 1 file changed +4
-6
lines changed
throttling/src/test/java/com/iluwatar/throttling
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 22
22
*/
23
23
package com .iluwatar .throttling ;
24
24
25
- import com .iluwatar .throttling .timer .ThrottleTimerImpl ;
26
25
import com .iluwatar .throttling .timer .Throttler ;
27
- import org .junit .jupiter .api .Disabled ;
28
26
import org .junit .jupiter .api .Test ;
29
27
30
- import static org .junit .jupiter .api .Assertions .assertTrue ;
28
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
31
29
32
30
/**
33
31
* B2BServiceTest class to test the B2BService
34
32
*/
35
33
public class B2BServiceTest {
36
34
37
- @ Disabled
38
35
@ Test
39
36
public void dummyCustomerApiTest () {
40
37
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 = () -> {};
42
40
B2BService service = new B2BService (timer );
43
41
44
42
for (int i = 0 ; i < 5 ; i ++) {
45
43
service .dummyCustomerApi (tenant );
46
44
}
47
45
long counter = CallsCount .getCount (tenant .getName ());
48
- assertTrue ( counter == 2 , "Counter limit must be reached" );
46
+ assertEquals ( 2 , counter , "Counter limit must be reached" );
49
47
}
50
48
}
You can’t perform that action at this time.
0 commit comments