【发布时间】:2020-03-19 07:16:59
【问题描述】:
我正在尝试使用 TestContainers 中的PostgreSQLContainer (https://github.com/testcontainers/testcontainers-java + https://www.testcontainers.org/) 来对我的 JPA 存储库进行单元测试。
我这样声明我的容器:
private val postgresqlContainer = PostgreSQLContainer("postgres:12-alpine")
但是,我遇到了以下错误,来自 Intellij IDE:
没有足够的信息来推断类型变量 SELF
我尝试启动服务时的完整错误是:
错误:(26, 43) Kotlin:类型推断失败:信息不足 在构造函数 PostgreSQLContainer
!>(p0: String!) 请指定 明确的。
【问题讨论】:
标签: java spring-boot kotlin testcontainers