use of org.springframework.retry.support.DefaultRetryState in project spring-integration by spring-projects.
the class SpelExpressionRetryStateGeneratorTests method testForceRefreshElvis.
@Test
public void testForceRefreshElvis() {
SpelExpressionRetryStateGenerator generator = new SpelExpressionRetryStateGenerator("headers['foo']", "headers['noHeader']?:true");
RetryState state = generator.determineRetryState(message);
assertEquals("bar", state.getKey());
assertTrue(((DefaultRetryState) state).isForceRefresh());
assertTrue(state.rollbackFor(new RuntimeException()));
}
use of org.springframework.retry.support.DefaultRetryState in project spring-integration by spring-projects.
the class SpelExpressionRetryStateGeneratorTests method testClassifier.
@Test
public void testClassifier() {
SpelExpressionRetryStateGenerator generator = new SpelExpressionRetryStateGenerator("headers['foo']");
generator.setClassifier(new ClassifierSupport<Throwable, Boolean>(false));
RetryState state = generator.determineRetryState(message);
assertEquals("bar", state.getKey());
assertFalse(((DefaultRetryState) state).isForceRefresh());
assertFalse(state.rollbackFor(new RuntimeException()));
}
use of org.springframework.retry.support.DefaultRetryState in project spring-integration by spring-projects.
the class SpelExpressionRetryStateGeneratorTests method testBasicConfig.
@Test
public void testBasicConfig() {
RetryState state = configGenerator.determineRetryState(message);
assertEquals("bar", state.getKey());
assertFalse(((DefaultRetryState) state).isForceRefresh());
assertTrue(state.rollbackFor(new RuntimeException()));
}
Aggregations