Search in sources :

Example 1 with Tracing

use of io.lettuce.core.tracing.Tracing in project spring-boot by spring-projects.

the class RedisAutoConfigurationTests method testCustomizeClientResources.

@Test
void testCustomizeClientResources() {
    Tracing tracing = mock(Tracing.class);
    this.contextRunner.withBean(ClientResourcesBuilderCustomizer.class, () -> (builder) -> builder.tracing(tracing)).run((context) -> {
        DefaultClientResources clientResources = context.getBean(DefaultClientResources.class);
        assertThat(clientResources.tracing()).isEqualTo(tracing);
    });
}
Also used : StringRedisTemplate(org.springframework.data.redis.core.StringRedisTemplate) Arrays(java.util.Arrays) ClusterTopologyRefreshOptions(io.lettuce.core.cluster.ClusterTopologyRefreshOptions) DefaultClientResources(io.lettuce.core.resource.DefaultClientResources) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) ApplicationContextRunner(org.springframework.boot.test.context.runner.ApplicationContextRunner) LettuceClientConfiguration(org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration) RedisSentinelConfiguration(org.springframework.data.redis.connection.RedisSentinelConfiguration) ContextConsumer(org.springframework.boot.test.context.runner.ContextConsumer) RefreshTrigger(io.lettuce.core.cluster.ClusterTopologyRefreshOptions.RefreshTrigger) GenericObjectPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig) RedisClusterConfiguration(org.springframework.data.redis.connection.RedisClusterConfiguration) Duration(java.time.Duration) ClientOptions(io.lettuce.core.ClientOptions) RedisStandaloneConfiguration(org.springframework.data.redis.connection.RedisStandaloneConfiguration) ClusterClientOptions(io.lettuce.core.cluster.ClusterClientOptions) Tracing(io.lettuce.core.tracing.Tracing) EnumSet(java.util.EnumSet) Assertions.assertThatIllegalStateException(org.assertj.core.api.Assertions.assertThatIllegalStateException) AutoConfigurations(org.springframework.boot.autoconfigure.AutoConfigurations) RedisNode(org.springframework.data.redis.connection.RedisNode) RedisOperations(org.springframework.data.redis.core.RedisOperations) Set(java.util.Set) ReflectionTestUtils(org.springframework.test.util.ReflectionTestUtils) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) LettuceConnectionFactory(org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory) Collectors(java.util.stream.Collectors) Pool(org.springframework.boot.autoconfigure.data.redis.RedisProperties.Pool) Consumer(java.util.function.Consumer) Test(org.junit.jupiter.api.Test) Configuration(org.springframework.context.annotation.Configuration) List(java.util.List) AssertableApplicationContext(org.springframework.boot.test.context.assertj.AssertableApplicationContext) LettuceClientConfigurationBuilder(org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder) LettucePoolingClientConfiguration(org.springframework.data.redis.connection.lettuce.LettucePoolingClientConfiguration) JedisConnectionFactory(org.springframework.data.redis.connection.jedis.JedisConnectionFactory) Bean(org.springframework.context.annotation.Bean) StringUtils(org.springframework.util.StringUtils) Mockito.mock(org.mockito.Mockito.mock) Tracing(io.lettuce.core.tracing.Tracing) DefaultClientResources(io.lettuce.core.resource.DefaultClientResources) Test(org.junit.jupiter.api.Test)

Aggregations

ClientOptions (io.lettuce.core.ClientOptions)1 ClusterClientOptions (io.lettuce.core.cluster.ClusterClientOptions)1 ClusterTopologyRefreshOptions (io.lettuce.core.cluster.ClusterTopologyRefreshOptions)1 RefreshTrigger (io.lettuce.core.cluster.ClusterTopologyRefreshOptions.RefreshTrigger)1 DefaultClientResources (io.lettuce.core.resource.DefaultClientResources)1 Tracing (io.lettuce.core.tracing.Tracing)1 Duration (java.time.Duration)1 Arrays (java.util.Arrays)1 EnumSet (java.util.EnumSet)1 List (java.util.List)1 Set (java.util.Set)1 Consumer (java.util.function.Consumer)1 Collectors (java.util.stream.Collectors)1 GenericObjectPoolConfig (org.apache.commons.pool2.impl.GenericObjectPoolConfig)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 Assertions.assertThatIllegalStateException (org.assertj.core.api.Assertions.assertThatIllegalStateException)1 Test (org.junit.jupiter.api.Test)1 Mockito.mock (org.mockito.Mockito.mock)1 AutoConfigurations (org.springframework.boot.autoconfigure.AutoConfigurations)1 Pool (org.springframework.boot.autoconfigure.data.redis.RedisProperties.Pool)1