问题描述
我有点困惑,因为我正在尝试模拟一些容器数据库并环顾四周,许多都引用了这两个库,例如这个示例:
https://github.com/mydeveloperplanet/myliquibaseplanet/blob/feature/testcontainers/pom.xml
但是,我在本地管理它们和将它们集成到我的 bitbucket 管道之间遇到了许多问题。
是否有一些关于启动 db 容器以及这两个库的哪些版本彼此兼容的可靠文档。
解决方法
https://github.com/Playtika/testcontainers-spring-boot 是 https://github.com/testcontainers/testcontainers-java 的包装器,为 Spring Boot 和预配置容器提供自动配置。
主要库是 testcontainers-java,你应该参考它的文档:
https://www.testcontainers.org
此外,Spring Boot 团队在更轻松的集成方面取得了很大进展,如今在 Spring Boot 中使用 testcontainers-java 非常容易:
https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-testcontainers