RedisTemplate не может получить данные от локального redis - PullRequest
0 голосов
/ 29 марта 2020

В моем локальном redis

lrange tmpList range 0 10
"a"
"b"

my redisTest

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import java.util.List;

@SpringBootTest

    public class RedisTest {


        @Autowired
        RedisTemplate redisTemplate;


        @Test
        void showRedisTemplate() {
            List<String> strings = redisTemplate.opsForList().range("tmpList", 0, 10);
            System.out.println(strings.get(0));
        }

    }

отображается java .lang.IndexOutOfBoundsException: Index: 0, Size: 0

мой редис 5.05

...