Fix: 테스트 시 redisson 의존성 문제 해결 #27
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#️⃣ 연관된 이슈
📚 배경
Redisson 테스트 시 프로덕션 코드의 Redisson 빈도 같이 생성되어 충돌이 발생한다고 이슈에 적어놨었는데, 그건 아니였고
테스트 프로퍼티가 설정되고(REDIS_HOST, REDIS_PORT, REDIS_PASSWORD), 테스트용 레디스가 실행되고 그 설정 정보가 저장되는데 이때 이게 spring.data.redis.host, spring.data.redis.port, spring.data.redis.password에 저장되어서 프로덕션단의 RedissonClient의 연결 오류가 났던 상황이었습니다.
결론적으로는 프로덕션단의 레디스 관련 코드들이 application-dev.properties들의 변수들을 참조하는데, 테스트 변수들이 application.properties의 값들을 변경해서 생긴 문제였습니다.
그런데 Redisson만 오류가 났던 이유는 LettuceConnectionFactory는 Lazy 연결로 실제로 필요할 때만 연결이 성립되서 오류가 나지 않고 나중에 테스트에서 사용될 때는 테스트용 LettuceConnectionFactory가 먼저 주입되서 문제가 없던 것이었습니다.
📝 작업 내용
📸 스크린샷
x
💬 리뷰 요구사항
x
✏ Git Close
close #25