【发布时间】:2019-11-25 07:23:54
【问题描述】:
我的 IDE 中出现以下错误:
参数化类“GenericContainer”检查信息的原始使用: 报告类型参数的参数化类的任何使用 被省略。参数化类型的这种原始使用在 Java 中是有效的, 但破坏了使用类型参数的目的,并且可能掩盖错误。
我检查了文档,并且创作者也到处使用原始类型: https://www.testcontainers.org/quickstart/junit_4_quickstart/ f.e.:
@Rule
public GenericContainer redis = new GenericContainer<>("redis:5.0.3-alpine")
.withExposedPorts(6379);
我不明白这种方法。谁能解释我应该如何参数化 GenericContainer?
【问题讨论】:
标签: testcontainers