Skip to content

Commit

Permalink
Merge branch 'dev' into feat/be-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tank3a committed Aug 23, 2023
2 parents e9093a7 + c552d2d commit eb1d62b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion backend/src/main/java/autoever2/cartag/RedisConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ void testShare() {
void testBoughtInfo(){
List<BoughtCarDto> 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());
}
}

0 comments on commit eb1d62b

Please sign in to comment.