Class CircuitBreakerInitialSuccessTest
java.lang.Object
org.jboss.arquillian.testng.Arquillian
org.eclipse.microprofile.fault.tolerance.tck.CircuitBreakerInitialSuccessTest
- All Implemented Interfaces:
org.testng.IHookable
,org.testng.ITestNGListener
public class CircuitBreakerInitialSuccessTest
extends org.jboss.arquillian.testng.Arquillian
Test CircuitBreaker using different success/failure pattern.
- Author:
- Neil Young
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.arquillian.testng.Arquillian
org.jboss.arquillian.testng.Arquillian.UpdateResultListener
-
Field Summary
Fields inherited from class org.jboss.arquillian.testng.Arquillian
ARQUILLIAN_DATA_PROVIDER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jboss.shrinkwrap.api.spec.WebArchive
deploy()
void
Analagous to testCircuitDefaultSuccessThreshold but with a different success/failure pattern for the service that is called.Methods inherited from class org.jboss.arquillian.testng.Arquillian
arquillianAfterClass, arquillianAfterSuite, arquillianAfterTest, arquillianArgumentProvider, arquillianBeforeClass, arquillianBeforeSuite, arquillianBeforeTest, run
-
Constructor Details
-
CircuitBreakerInitialSuccessTest
public CircuitBreakerInitialSuccessTest()
-
-
Method Details
-
deploy
@Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive deploy() -
testCircuitInitialSuccessDefaultSuccessThreshold
public void testCircuitInitialSuccessDefaultSuccessThreshold()Analagous to testCircuitDefaultSuccessThreshold but with a different success/failure pattern for the service that is called. In this case, the service initially succeeds. With requestVolumeThreshold = 4, failureRatio=0.75 and successThreshold = 1 the expected behaviour is, Execution Behaviour ========= ========= 1 SUCCESS 2 TestException 3 TestException 4 TestException 5 CircuitBreakerOpenException Pause for longer than CircuitBreaker delay, so that it transitions to half-open 6 SUCCEED (CircuitBreaker will be re-closed as successThreshold is 1. The impact of the success of the service and the closure of the Circuit is to reset the rolling failure window to an empty state. Therefore another 4 requests need to be made - of which at least 3 need to fail - for the Circuit to open again) 7 SUCCESS 8 TestException 9 TestException 10 TestException 11 CircuitBreakerOpenException
-