Upgrade to Spring Boot 2.6.0-M3.
This commit is contained in:
committed by
Greg L. Turnquist
parent
fc8cdbe864
commit
a171e33444
@@ -17,11 +17,9 @@ package example.springdata.redis;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.core.ReactiveRedisTemplate;
|
||||
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
||||
@@ -36,8 +34,6 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
@SpringBootApplication
|
||||
public class RedisTestConfiguration {
|
||||
|
||||
@Autowired RedisConnectionFactory factory;
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory();
|
||||
@@ -80,6 +76,6 @@ public class RedisTestConfiguration {
|
||||
* Clear database before shut down.
|
||||
*/
|
||||
public @PreDestroy void flushTestDb() {
|
||||
factory.getConnection().flushDb();
|
||||
redisConnectionFactory().getConnection().flushDb();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user