I can see that I can programmatically set the state to force open like so using the following code: CircuitBreaker Forced Open State
But is there a way to set a property to set the state to this immediately when the application starts, so it can be used with tests?
Update: Nowadays there is methods to transition
* Transitions the state machine to CLOSED state.
*
* Should only be used, when you want to force a state transition. State transition are normally done internally.
*/
void transitionToClosedState();
/**
* Transitions the state machine to OPEN state.
*
* Should only be used, when you want to force a state transition. State transition are normally done internally.
*/
void transitionToOpenState();
/**
* Transitions the state machine to HALF_OPEN state.
*
* Should only be used, when you want to force a state transition. State transition are normally done internally.
*/
void transitionToHalfOpenState();
/**
* Transitions the state machine to a DISABLED state, stopping state transition, metrics and event publishing.
*
* Should only be used, when you want to disable the circuit breaker allowing all calls to pass.
* To recover from this state you must force a new state transition
*/
void transitionToDisabledState();```