diff --git a/backend/src/main/java/autoever2/cartag/RedisConfig.java b/backend/src/main/java/autoever2/cartag/RedisConfig.java index e0104bc..cfb01b7 100644 --- a/backend/src/main/java/autoever2/cartag/RedisConfig.java +++ b/backend/src/main/java/autoever2/cartag/RedisConfig.java @@ -9,6 +9,7 @@ import org.springframework.data.redis.cache.RedisCacheConfiguration; import org.springframework.data.redis.cache.RedisCacheManager; import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.RedisStandaloneConfiguration; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.RedisSerializationContext; @@ -26,9 +27,16 @@ public class RedisConfig { @Value("${spring.redis.port}") // application.properties 에서 불러옴 private int port; + @Value("${spring.redis.password}") + private String password; + @Bean public RedisConnectionFactory redisConnectionFactory() { - return new LettuceConnectionFactory(host, port); + RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(); + redisStandaloneConfiguration.setHostName(host); + redisStandaloneConfiguration.setPort(port); + redisStandaloneConfiguration.setPassword(password); + return new LettuceConnectionFactory(redisStandaloneConfiguration); } @Bean diff --git a/backend/src/test/java/autoever2/cartag/integration/QuoteTest.java b/backend/src/test/java/autoever2/cartag/integration/QuoteTest.java index d7581da..2a99ad2 100644 --- a/backend/src/test/java/autoever2/cartag/integration/QuoteTest.java +++ b/backend/src/test/java/autoever2/cartag/integration/QuoteTest.java @@ -73,8 +73,8 @@ void testShare() { void testBoughtInfo(){ List allHistorySum = quoteController.getAllHistorySum(1); - assertEquals(144, allHistorySum.size()); - assertEquals(228, allHistorySum.get(0).getCount()); - assertEquals(46200000L, allHistorySum.get(1).getTotalPrice()); + assertEquals(6, allHistorySum.size()); + assertEquals(2, allHistorySum.get(0).getCount()); + assertEquals(42300000L, allHistorySum.get(1).getTotalPrice()); } }