Test ‐ TestContainer 오픈 소스 - dnwls16071/Backend_Study_TIL GitHub Wiki
📚 TestContainer
- 테스트에서 도커 컨테이너를 실행할 수 있는 오픈 소스 라이브러리
- 테스트 실행시 DB를 설정하거나 별도의 프로그램 또는 스크립트를 실행할 필요가 없다.
- 보다 Production에 가까운 테스트를 만들 수 있다.
- 테스트가 느려진다.
📚 TestContainer 의존성 추가
// TestContainer
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'org.testcontainers:junit-jupiter'
// PostgreSQL
testImplementation 'org.testcontainers:postgresql'