Example usage for org.springframework.data.redis SettingsUtils socketConfiguration

List of usage examples for org.springframework.data.redis SettingsUtils socketConfiguration

Introduction

In this page you can find the example usage for org.springframework.data.redis SettingsUtils socketConfiguration.

Prototype

public static RedisSocketConfiguration socketConfiguration() 

Source Link

Document

Construct a new RedisSocketConfiguration initialized with test endpoint settings.

Usage

From source file:org.springframework.data.redis.connection.lettuce.LettuceConnectionFactoryTests.java

@Test // DATAREDIS-687
public void connectsThroughRedisSocket() {

    assumeTrue(EpollProvider.isAvailable() || KqueueProvider.isAvailable());
    assumeTrue(new File(SettingsUtils.getSocket()).exists());

    LettuceClientConfiguration configuration = LettuceTestClientConfiguration.create();

    LettuceConnectionFactory factory = new LettuceConnectionFactory(SettingsUtils.socketConfiguration(),
            configuration);/*from   www  .j  a va2  s . c o m*/
    factory.setShareNativeConnection(false);
    factory.afterPropertiesSet();

    RedisConnection connection = factory.getConnection();
    assertThat(connection.ping(), is(equalTo("PONG")));

    connection.close();
    factory.destroy();
}