더 자바, 애플리케이션을 테스트하는 다양한 방법

Ch03. 도커와 테스트 - Testcontainers 기능 살펴보기

webmaster 2022. 1. 7. 13:38
728x90
  • 컨테이너 만들기
    • New GenericContainer(String imageName)
  • 네트워크 
    • withExposedPorts(int...) 
    • getMappedPort(int)
  • 환경 변수 설정 
    • withEnv(key, value)
  • 명령어 실행
    • withCommand(String cmd...)
  • 사용할 준비가 됐는지 확인하기
    • waitingFor(Wait)
    • Wait.forHttp(String url)
    • Wait.forLogMessage(String message)
  • 로그 살펴보기 
    • getLogs() 
    • followOutput()
  • 환경변수와 포트를 가지고 컨테이너를 만들수 있다.
  • log를 넣어줄 수도 있다.
728x90