如何修复异常"DataflowAssert requires that JUnit and Hamcrest be linked in"?



当运行使用 DataflowAssert 的数据流单元测试时,我得到异常

java.lang.RuntimeException: DataflowAssert requires that JUnit and Hamcrest be linked in.

我需要将哪些依赖项添加到我的 pom 文件才能修复此异常?

将以下依赖项添加到 pom 文件以链接所需的库中

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.11</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.hamcrest</groupId>
  <artifactId>hamcrest-all</artifactId>
  <version>1.3</version>
  <scope>test</scope>
</dependency>  

相关内容

最新更新