Example usage for org.springframework.data.redis.connection.lettuce LettuceTestClientConfiguration create

List of usage examples for org.springframework.data.redis.connection.lettuce LettuceTestClientConfiguration create

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection.lettuce LettuceTestClientConfiguration create.

Prototype

public static LettuceClientConfiguration create() 

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);//w ww  .  j av  a  2s .c o  m
    factory.setShareNativeConnection(false);
    factory.afterPropertiesSet();

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

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