File tree Expand file tree Collapse file tree 2 files changed +8
-13
lines changed
src/test/java/com/geckotechnology/simpleCircuitBreaker Expand file tree Collapse file tree 2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,11 @@ public void test() {
2121 public void run () {
2222 for (int i = 0 ; i <LOOP_COUNT ; i ++) {
2323 assertTrue (circuitBreaker .getBreakerState () instanceof BreakerDisabledState );
24- if (circuitBreaker .isClosedForThisCall ()) {
25- assertTrue (circuitBreaker .getBreakerState () instanceof BreakerDisabledState );
26- TestUtils .sleep (SLEEP_TIME );
27- circuitBreaker .callSucceeded (SLEEP_TIME );
28- }
29- else
30- fail ("circuitBreaker should always be closed" );
24+ assertTrue (circuitBreaker .isClosedForThisCall ());
25+ assertTrue (circuitBreaker .getBreakerState () instanceof BreakerDisabledState );
26+ TestUtils .sleep (SLEEP_TIME );
27+ circuitBreaker .callSucceeded (SLEEP_TIME );
28+ assertTrue (circuitBreaker .getBreakerState () instanceof BreakerDisabledState );
3129 }
3230 }
3331 };
Original file line number Diff line number Diff line change @@ -21,12 +21,9 @@ public void test() {
2121 public void run () {
2222 for (int i = 0 ; i <LOOP_COUNT ; i ++) {
2323 assertTrue (circuitBreaker .getBreakerState () instanceof BreakerForcedOpenState );
24- if (circuitBreaker .isClosedForThisCall ())
25- fail ("circuitBreaker should always be closed" );
26- else {
27- assertTrue (circuitBreaker .getBreakerState () instanceof BreakerForcedOpenState );
28- TestUtils .sleep (SLEEP_TIME );
29- }
24+ assertFalse (circuitBreaker .isClosedForThisCall ());
25+ assertTrue (circuitBreaker .getBreakerState () instanceof BreakerForcedOpenState );
26+ TestUtils .sleep (SLEEP_TIME );
3027 }
3128 }
3229 };
You can’t perform that action at this time.
0 commit comments