use of cn.taketoday.retry.policy.MapRetryContextCache in project today-framework by TAKETODAY.
the class CircuitBreakerStatisticsTests method init.
@Before
public void init() {
this.callback = new MockRetryCallback();
this.recovery = new RecoveryCallback<Object>() {
@Override
public Object recover(RetryContext context) throws Exception {
return RECOVERED;
}
};
this.retryTemplate = new RetryTemplate();
this.cache = new MapRetryContextCache();
this.retryTemplate.setRetryContextCache(this.cache);
retryTemplate.setListeners(new RetryListener[] { listener });
this.callback.setAttemptsBeforeSuccess(1);
// No rollback by default (so exceptions are not rethrown)
this.state = new DefaultRetryState("retry", new BinaryExceptionClassifier(false));
}
Aggregations