use of io.github.resilience4j.timelimiter.configure.TimeLimiterConfigurationProperties in project resilience4j by resilience4j.
the class SpringBootCommonTest method testTimeLimiterCommonConfig.
@Test
public void testTimeLimiterCommonConfig() {
TimeLimiterConfigurationOnMissingBean timeLimiterConfigurationOnMissingBean = new TimeLimiterConfigurationOnMissingBean();
assertThat(timeLimiterConfigurationOnMissingBean.reactorTimeLimiterAspectExt()).isNotNull();
assertThat(timeLimiterConfigurationOnMissingBean.rxJava2TimeLimiterAspectExt()).isNotNull();
assertThat(timeLimiterConfigurationOnMissingBean.timeLimiterRegistry(new TimeLimiterConfigurationProperties(), new DefaultEventConsumerRegistry<>(), new CompositeRegistryEventConsumer<>(Collections.emptyList()), new CompositeCustomizer<>(Collections.singletonList(TimeLimiterConfigCustomizer.of("backend", builder -> builder.timeoutDuration(Duration.ofSeconds(10))))))).isNotNull();
final DefaultSpelResolver spelResolver = new DefaultSpelResolver(new SpelExpressionParser(), new StandardReflectionParameterNameDiscoverer(), new GenericApplicationContext());
final FallbackDecorators fallbackDecorators = new FallbackDecorators(Arrays.asList(new CompletionStageFallbackDecorator()));
assertThat(timeLimiterConfigurationOnMissingBean.timeLimiterAspect(new TimeLimiterConfigurationProperties(), TimeLimiterRegistry.ofDefaults(), Collections.emptyList(), new FallbackExecutor(spelResolver, fallbackDecorators), spelResolver, null)).isNotNull();
assertThat(timeLimiterConfigurationOnMissingBean.timeLimiterRegistryEventConsumer(Optional.empty())).isNotNull();
}
use of io.github.resilience4j.timelimiter.configure.TimeLimiterConfigurationProperties in project resilience4j by resilience4j.
the class RefreshScopedTimeLimiterConfigurationTest method testTimeLimiterCloudCommonConfig.
@Test
public void testTimeLimiterCloudCommonConfig() {
TimeLimiterConfig timeLimiterConfig = new TimeLimiterConfig();
assertThat(timeLimiterConfig.timeLimiterRegistry(new TimeLimiterConfigurationProperties(), new DefaultEventConsumerRegistry<>(), new CompositeRegistryEventConsumer<>(Collections.emptyList()), new CompositeCustomizer<>(Collections.emptyList()))).isNotNull();
}
Aggregations