我的 IDE 中出现以下错误:
参数化类“GenericContainer”的原始使用检查信息:报告省略类型参数的参数化类的任何使用。参数化类型的这种原始使用在 Java 中是有效的,但违背了使用类型参数的目的,并且可能掩盖错误。
我已经检查了文档,并且创建者也到处使用原始类型: https: //www.testcontainers.org/quickstart/junit_4_quickstart/fe:
@Rule
public GenericContainer redis = new GenericContainer<>("redis:5.0.3-alpine")
.withExposedPorts(6379);
我不明白这种方法。谁能解释我应该如何参数化 GenericContainer<>?