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

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

Introduction

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

Prototype

public static String getSocket() 

Source Link

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);/*ww  w. 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();
}