首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将org.testcontainers从1.10.6升级到1.15.1 - PostgreSQLContainer.start()

将org.testcontainers从1.10.6升级到1.15.1 - PostgreSQLContainer.start()
EN

Stack Overflow用户
提问于 2022-05-30 11:28:40
回答 1查看 114关注 0票数 0

我升级了我的org.testcontainers:

代码语言:javascript
复制
<dependency>
          <groupId>org.testcontainers</groupId>
          <artifactId>junit-jupiter</artifactId>
          <version>1.15.1</version>
          <scope>test</scope>
</dependency>

但是,我不能再使用start()方法了:

代码语言:javascript
复制
public class ComponentTest {
      public static final PostgreSQLContainer<?> postgreDBContainer = new 
                PostgreSQLContainer<>("postgres:13");
      static {
        postgreDBContainer.start();
      }
}

这个问题有什么解决办法吗?

EN

回答 1

Stack Overflow用户

发布于 2022-05-31 09:19:17

你可能错过了额外的依赖吗?

代码语言:javascript
复制
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>postgresql</artifactId>
    <version>1.15.1</version>
    <scope>test</scope>
</dependency>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72433616

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档