springboot怎么建测试类测试接口

2025-04-17 06:45:02
推荐回答(1个)
回答1:

1、pom文件引入即

org.springframework.boot
spring-boot-starter-redis

2、编写CacheService接口使用redisCacheServiceImpl实现接口
官网原文说提供三接口注入自实现其实现类默认本端口号6379redis
You can inject an auto-configured RedisConnectionFactory, StringRedisTemplate or vanilla RedisTemplate instance as you would any other Spring Bean.By default the instance will attempt to connect to a Redis server using localhost:6379: