테스트 통합 환경 설정 추가

This commit is contained in:
2026-05-29 15:58:33 +09:00
parent 00316ba013
commit ebfbf7b597
8 changed files with 182 additions and 25 deletions

View File

@@ -27,15 +27,17 @@ class RedisConfig(
@Value("\${spring.redis.host}")
private val host: String,
@Value("\${spring.redis.port}")
private val port: Int
private val port: Int,
@Value("\${spring.redis.ssl-enabled:true}")
private val sslEnabled: Boolean
) {
@Bean(destroyMethod = "shutdown")
fun redissonClient(): RedissonClient {
val config = Config()
val scheme = if (sslEnabled) "rediss" else "redis"
config.useSingleServer()
.setAddress("rediss://$host:$port")
.setSslEnableEndpointIdentification(true)
.setSslTruststore(null)
.setAddress("$scheme://$host:$port")
.setSslEnableEndpointIdentification(sslEnabled)
.setDnsMonitoringInterval(30000)
.setConnectionMinimumIdleSize(0)
.setConnectionPoolSize(5)
@@ -44,12 +46,14 @@ class RedisConfig(
@Bean
fun redisConnectionFactory(): RedisConnectionFactory {
val clientConfiguration = LettuceClientConfiguration.builder()
.useSsl()
.disablePeerVerification()
.build()
val clientConfigurationBuilder = LettuceClientConfiguration.builder()
if (sslEnabled) {
clientConfigurationBuilder
.useSsl()
.disablePeerVerification()
}
return LettuceConnectionFactory(RedisStandaloneConfiguration(host, port), clientConfiguration)
return LettuceConnectionFactory(RedisStandaloneConfiguration(host, port), clientConfigurationBuilder.build())
}
@Bean