use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-integration by spring-projects.
the class RedisQueueGatewayIntegrationTests method setup.
public void setup() {
RedisConnectionFactory jcf = getConnectionFactoryForTest();
jcf.getConnection().del(this.queueName);
}
use of org.springframework.data.redis.connection.RedisConnectionFactory in project pivotal-cla by pivotalsoftware.
the class SessionConfig method cloudRedisConnectionFactory.
@Profile(GitHubClaProfiles.CLOUDFOUNDRY)
@Bean
public RedisConnectionFactory cloudRedisConnectionFactory() {
CloudFactory cloudFactory = new CloudFactory();
Cloud cloud = cloudFactory.getCloud();
RedisConnectionFactory connectionFactory = cloud.getSingletonServiceConnector(RedisConnectionFactory.class, null);
if (connectionFactory instanceof LettuceConnectionFactory) {
((LettuceConnectionFactory) connectionFactory).setShutdownTimeout(0);
}
return connectionFactory;
}
use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-session by spring-projects.
the class AbstractHttpSessionListenerTests method createMockRedisConnection.
static RedisConnectionFactory createMockRedisConnection() {
RedisConnectionFactory factory = mock(RedisConnectionFactory.class);
RedisConnection connection = mock(RedisConnection.class);
given(factory.getConnection()).willReturn(connection);
given(connection.getConfig(anyString())).willReturn(new Properties());
return factory;
}
use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-session by spring-projects.
the class RedisHttpSessionConfigurationTests method primaryConnectionFactoryRedisConfig.
@Test
public void primaryConnectionFactoryRedisConfig() {
registerAndRefresh(RedisConfig.class, PrimaryConnectionFactoryRedisConfig.class);
RedisOperationsSessionRepository repository = this.context.getBean(RedisOperationsSessionRepository.class);
RedisConnectionFactory redisConnectionFactory = this.context.getBean("primaryRedisConnectionFactory", RedisConnectionFactory.class);
assertThat(repository).isNotNull();
assertThat(redisConnectionFactory).isNotNull();
RedisOperations redisOperations = (RedisOperations) ReflectionTestUtils.getField(repository, "sessionRedisOperations");
assertThat(redisOperations).isNotNull();
assertThat(ReflectionTestUtils.getField(redisOperations, "connectionFactory")).isEqualTo(redisConnectionFactory);
}
use of org.springframework.data.redis.connection.RedisConnectionFactory in project spring-session by spring-projects.
the class RedisHttpSessionConfigurationXmlTests method connectionFactory.
static RedisConnectionFactory connectionFactory() {
RedisConnectionFactory factory = mock(RedisConnectionFactory.class);
RedisConnection connection = mock(RedisConnection.class);
given(factory.getConnection()).willReturn(connection);
given(connection.getConfig(anyString())).willReturn(new Properties());
return factory;
}
Aggregations