@@ -0,0 +1,2591 @@
+package com.github.changeworld.redis.client.lettuce;%0A%0Aimport com.github.changeworld.redis.client.SpringDataRedisClient;%0Aimport org.junit.AfterClass;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport org.springframework.data.redis.connection.lettuce.DefaultLettucePool;%0Aimport org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;%0Aimport redis.embedded.RedisServer;%0A%0Aimport java.io.IOException;%0A%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assert.fail;%0A%0A/**%0A * @author changeworld%0A */%0Apublic class SpringDataRedisClientTest %7B%0A    private static RedisServer redisServer;%0A%0A    private static final String FOO = %22foo%22;%0A    private static final String BAR = %22bar%22;%0A    private static final String HOST = %22localhost%22;%0A    private static final int PORT = 6379;%0A%0A    @BeforeClass%0A    public static void beforeClass() throws IOException %7B%0A        redisServer = new RedisServer(PORT);%0A        redisServer.start();%0A    %7D%0A%0A    @AfterClass%0A    public static void afterClass() throws IOException %7B%0A        redisServer.stop();%0A    %7D%0A%0A    @Test%0A    public void shouldSpringDataRedisCanSet() %7B%0A        Boolean flag = true;%0A        try %7B%0A            DefaultLettucePool defaultLettucePool = new DefaultLettucePool(HOST, PORT);%0A            defaultLettucePool.afterPropertiesSet();%0A            LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(defaultLettucePool);%0A            lettuceConnectionFactory.afterPropertiesSet();%0A            lettuceConnectionFactory.setShareNativeConnection(true);%0A            SpringDataRedisClient client = new SpringDataRedisClient(lettuceConnectionFactory);%0A            client.set(FOO, BAR);%0A        %7D catch (Exception e) %7B%0A            flag = false;%0A            e.printStackTrace();%0A            fail();%0A        %7D%0A        assertTrue(flag);%0A    %7D%0A%0A    @Test%0A    public void shouldSpringDataRedisCanGetAfterSet() %7B%0A        try %7B%0A            DefaultLettucePool defaultLettucePool = new DefaultLettucePool(HOST, PORT);%0A            defaultLettucePool.afterPropertiesSet();%0A            LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(defaultLettucePool);%0A            lettuceConnectionFactory.afterPropertiesSet();%0A            lettuceConnectionFactory.setShareNativeConnection(true);%0A            SpringDataRedisClient client = new SpringDataRedisClient(lettuceConnectionFactory);%0A            client.set(FOO, BAR);%0A            assertTrue(client.get(FOO).equals(BAR));%0A        %7D catch (Exception e) %7B%0A            e.printStackTrace();%0A            fail();%0A        %7D%0A    %7D%0A%7D%0A

Add Spring Data Redis via lettuce client