Search in sources :

Example 6 with StandardReflectionParameterNameDiscoverer

use of org.springframework.core.StandardReflectionParameterNameDiscoverer in project resilience4j by resilience4j.

the class SpringBootCommonTest method testRateLimiterCommonConfig.

@Test
public void testRateLimiterCommonConfig() {
    RateLimiterConfigurationOnMissingBean rateLimiterConfigurationOnMissingBean = new RateLimiterConfigurationOnMissingBean();
    assertThat(rateLimiterConfigurationOnMissingBean.reactorRateLimiterAspectExt()).isNotNull();
    assertThat(rateLimiterConfigurationOnMissingBean.rxJava2RateLimiterAspectExt()).isNotNull();
    assertThat(rateLimiterConfigurationOnMissingBean.rateLimiterRegistry(new RateLimiterConfigurationProperties(), new DefaultEventConsumerRegistry<>(), new CompositeRegistryEventConsumer<>(Collections.emptyList()), new CompositeCustomizer<>(Collections.emptyList()))).isNotNull();
    final FallbackDecorators fallbackDecorators = new FallbackDecorators(Arrays.asList(new CompletionStageFallbackDecorator()));
    final DefaultSpelResolver spelResolver = new DefaultSpelResolver(new SpelExpressionParser(), new StandardReflectionParameterNameDiscoverer(), new GenericApplicationContext());
    assertThat(rateLimiterConfigurationOnMissingBean.rateLimiterAspect(new RateLimiterConfigurationProperties(), RateLimiterRegistry.ofDefaults(), Collections.emptyList(), new FallbackExecutor(spelResolver, fallbackDecorators), spelResolver)).isNotNull();
    assertThat(rateLimiterConfigurationOnMissingBean.rateLimiterRegistryEventConsumer(Optional.empty())).isNotNull();
}
Also used : RateLimiterConfigurationProperties(io.github.resilience4j.ratelimiter.configure.RateLimiterConfigurationProperties) SpelExpressionParser(org.springframework.expression.spel.standard.SpelExpressionParser) StandardReflectionParameterNameDiscoverer(org.springframework.core.StandardReflectionParameterNameDiscoverer) GenericApplicationContext(org.springframework.context.support.GenericApplicationContext) CompletionStageFallbackDecorator(io.github.resilience4j.fallback.CompletionStageFallbackDecorator) AbstractRateLimiterConfigurationOnMissingBean(io.github.resilience4j.ratelimiter.autoconfigure.AbstractRateLimiterConfigurationOnMissingBean) DefaultSpelResolver(io.github.resilience4j.spelresolver.DefaultSpelResolver) FallbackDecorators(io.github.resilience4j.fallback.FallbackDecorators) FallbackExecutor(io.github.resilience4j.fallback.FallbackExecutor) Test(org.junit.Test)

Aggregations

StandardReflectionParameterNameDiscoverer (org.springframework.core.StandardReflectionParameterNameDiscoverer)6 SpelExpressionParser (org.springframework.expression.spel.standard.SpelExpressionParser)6 CompletionStageFallbackDecorator (io.github.resilience4j.fallback.CompletionStageFallbackDecorator)5 FallbackDecorators (io.github.resilience4j.fallback.FallbackDecorators)5 FallbackExecutor (io.github.resilience4j.fallback.FallbackExecutor)5 DefaultSpelResolver (io.github.resilience4j.spelresolver.DefaultSpelResolver)5 Test (org.junit.Test)5 GenericApplicationContext (org.springframework.context.support.GenericApplicationContext)5 CircuitBreakerConfigurationProperties (io.github.resilience4j.circuitbreaker.configure.CircuitBreakerConfigurationProperties)3 AbstractRateLimiterConfigurationOnMissingBean (io.github.resilience4j.ratelimiter.autoconfigure.AbstractRateLimiterConfigurationOnMissingBean)3 RateLimiterConfigurationProperties (io.github.resilience4j.ratelimiter.configure.RateLimiterConfigurationProperties)3 AbstractRetryConfigurationOnMissingBean (io.github.resilience4j.retry.autoconfigure.AbstractRetryConfigurationOnMissingBean)3 RetryConfigurationProperties (io.github.resilience4j.retry.configure.RetryConfigurationProperties)3 BulkheadRegistry (io.github.resilience4j.bulkhead.BulkheadRegistry)2 ThreadPoolBulkheadRegistry (io.github.resilience4j.bulkhead.ThreadPoolBulkheadRegistry)2 AbstractBulkheadConfigurationOnMissingBean (io.github.resilience4j.bulkhead.autoconfigure.AbstractBulkheadConfigurationOnMissingBean)2 BulkheadConfigurationProperties (io.github.resilience4j.bulkhead.configure.BulkheadConfigurationProperties)2 CircuitBreakerRegistry (io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry)2 AbstractCircuitBreakerConfigurationOnMissingBean (io.github.resilience4j.circuitbreaker.autoconfigure.AbstractCircuitBreakerConfigurationOnMissingBean)2 CompositeCustomizer (io.github.resilience4j.common.CompositeCustomizer)2