Package org.eclipse.microprofile.fault.tolerance.tck

# 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
Constructor
Description
`CircuitBreakerInitialSuccessTest()`

## Method Summary

Modifier and Type
Method
Description
`static org.jboss.shrinkwrap.api.spec.WebArchive`
`deploy()`
`void`
`testCircuitInitialSuccessDefaultSuccessThreshold()`
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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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