@Test
    public void testCircuit_TripAndReset() throws InterruptedException {
        Circuit circuit = new Circuit(/*limit*/ 5, /*window*/ 1, /*reset*/ 2);
        for (int iterations = 0; iterations < 2; iterations++) {
            Assert.assertFalse(circuit.isBroken());
            circuit.addFault();
            Assert.assertFalse(circuit.isBroken());
            circuit.addFault();
            circuit.addFault();
            circuit.addFault();
            Assert.assertFalse(circuit.isBroken());
            // On the 5th fault, the circuit will trip
            circuit.addFault();
            Assert.assertTrue(circuit.isBroken());
            
            // Cannot be reset yet
            Assert.assertFalse(circuit.isResettable());
            Assert.assertFalse(circuit.startReset());
            
            Thread.sleep(1000);

            // Still cannot be reset!
            Assert.assertFalse(circuit.isResettable());
    
            Thread.sleep(1000);
            // NOW it can be reset
            Assert.assertTrue(circuit.isResettable());
            
            Assert.assertFalse(circuit.isResetting());
            Assert.assertTrue(circuit.startReset());
            Assert.assertTrue(circuit.isResetting());
            Assert.assertFalse(circuit.isResettable());
            
            Assert.assertTrue(circuit.isBroken());
            Assert.assertTrue(circuit.reset());
            Assert.assertFalse(circuit.isResetting());
            Assert.assertFalse(circuit.isResettable());
            Assert.assertFalse(circuit.isBroken());
       }
    }
Test method for {@link io.apiman.plugins.circuit_breaker.Circuit#reset()}.
plugins/circuit-breaker-policy/src/test/java/io/apiman/plugins/circuit_breaker/CircuitTest.java