如何修复异常" DataflowAssert要求JUnit和Hamcrest链接在"?

时间:2015-01-25 18:17:46

标签: google-cloud-dataflow

运行使用DataflowAssert的Dataflow unittest时,我得到异常

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

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

1 个答案:

答案 0 :(得分:2)

将以下依赖项添加到您的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>