Search in sources :

Example 1 with RetryConfigurationProperties

use of io.github.resilience4j.retry.configure.RetryConfigurationProperties in project resilience4j by resilience4j.

the class SpringBootCommonTest method testRetryCommonConfig.

@Test
public void testRetryCommonConfig() {
    RetryConfigurationOnMissingBean retryConfigurationOnMissingBean = new RetryConfigurationOnMissingBean();
    assertThat(retryConfigurationOnMissingBean.reactorRetryAspectExt()).isNotNull();
    assertThat(retryConfigurationOnMissingBean.rxJava2RetryAspectExt()).isNotNull();
    assertThat(retryConfigurationOnMissingBean.retryRegistry(new RetryConfigurationProperties(), new DefaultEventConsumerRegistry<>(), new CompositeRegistryEventConsumer<>(Collections.emptyList()), new CompositeCustomizer<>(Collections.emptyList()))).isNotNull();
    final DefaultSpelResolver spelResolver = new DefaultSpelResolver(new SpelExpressionParser(), new StandardReflectionParameterNameDiscoverer(), new GenericApplicationContext());
    final FallbackDecorators fallbackDecorators = new FallbackDecorators(Collections.singletonList(new CompletionStageFallbackDecorator()));
    assertThat(retryConfigurationOnMissingBean.retryAspect(new RetryConfigurationProperties(), RetryRegistry.ofDefaults(), Collections.emptyList(), new FallbackExecutor(spelResolver, fallbackDecorators), spelResolver, null)).isNotNull();
    assertThat(retryConfigurationOnMissingBean.retryRegistryEventConsumer(Optional.empty())).isNotNull();
}
Also used : AbstractRetryConfigurationOnMissingBean(io.github.resilience4j.retry.autoconfigure.AbstractRetryConfigurationOnMissingBean) SpelExpressionParser(org.springframework.expression.spel.standard.SpelExpressionParser) StandardReflectionParameterNameDiscoverer(org.springframework.core.StandardReflectionParameterNameDiscoverer) GenericApplicationContext(org.springframework.context.support.GenericApplicationContext) CompletionStageFallbackDecorator(io.github.resilience4j.fallback.CompletionStageFallbackDecorator) DefaultSpelResolver(io.github.resilience4j.spelresolver.DefaultSpelResolver) RetryConfigurationProperties(io.github.resilience4j.retry.configure.RetryConfigurationProperties) FallbackDecorators(io.github.resilience4j.fallback.FallbackDecorators) FallbackExecutor(io.github.resilience4j.fallback.FallbackExecutor) Test(org.junit.Test)

Example 2 with RetryConfigurationProperties

use of io.github.resilience4j.retry.configure.RetryConfigurationProperties in project resilience4j by resilience4j.

the class RefreshScopedRetryConfigurationTest method testRetryCloudCommonConfig.

@Test
public void testRetryCloudCommonConfig() {
    RetryConfig retryConfig = new RetryConfig();
    assertThat(retryConfig.retryRegistry(new RetryConfigurationProperties(), new DefaultEventConsumerRegistry<>(), new CompositeRegistryEventConsumer<>(emptyList()), new CompositeCustomizer<>(Collections.emptyList()))).isNotNull();
}
Also used : RetryConfigurationProperties(io.github.resilience4j.retry.configure.RetryConfigurationProperties) Test(org.junit.Test)

Aggregations

RetryConfigurationProperties (io.github.resilience4j.retry.configure.RetryConfigurationProperties)2 Test (org.junit.Test)2 CompletionStageFallbackDecorator (io.github.resilience4j.fallback.CompletionStageFallbackDecorator)1 FallbackDecorators (io.github.resilience4j.fallback.FallbackDecorators)1 FallbackExecutor (io.github.resilience4j.fallback.FallbackExecutor)1 AbstractRetryConfigurationOnMissingBean (io.github.resilience4j.retry.autoconfigure.AbstractRetryConfigurationOnMissingBean)1 DefaultSpelResolver (io.github.resilience4j.spelresolver.DefaultSpelResolver)1 GenericApplicationContext (org.springframework.context.support.GenericApplicationContext)1 StandardReflectionParameterNameDiscoverer (org.springframework.core.StandardReflectionParameterNameDiscoverer)1 SpelExpressionParser (org.springframework.expression.spel.standard.SpelExpressionParser)1