我正在尝试使用来自 TestContainers (https://github.com/testcontainers/testcontainers-java+https://www.testcontainers.org/) 的 PostgreSQLContainer
来对我的 JPA 存储库进行单元测试。
我声明我的容器如下:
private val postgresqlContainer = PostgreSQLContainer("postgres:12-alpine")
然而,在 Intellij IDE 中,我遇到了以下错误:
没有足够的信息来推断类型变量 SELF
当我尝试启动服务时,出现了完整的错误:
Error:(26, 43) Kotlin: Type inference failed: Not enough information to infer parameter SELF in constructor PostgreSQLContainer<SELF : PostgreSQLContainer<SELF!>!>(p0: String!) Please specify it explicitly.