1. 代码已经发布了,见:https://gitee.com/xszhangmin/springboot-redis-demogit
2. 运行单元测试遇到了一个问题:redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool,一直报connection refused的错误,查了一遍,发现缘由了。redis
Redis 的配置文件默认是绑定本地ip的,解决方式是 将Redis 的redis.conf 文件中 bind 127.0.0.1注释掉。spring