intellij-idea 智能无法找到Flink Test Harness实用程序

vtwuwzda  于 2022-11-01  发布在  Flink
关注(0)|答案(2)|浏览(229)

我正在尝试使用Apache Flink(org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness)中的OneInputStreamOperatorTestHarness,但是Intellj无法解析符号。
我已经跟踪了offical docs,这个官方的blog on the flink website和这个stackoverflow question

piok6c0g

piok6c0g1#

尝试将以下内容添加到ur build.gradle的依赖项块中:

testImplementation 'org.apache.flink:flink-test-utils_2.11:1.14.2'
testImplementation 'org.apache.flink:flink-runtime:1.14.2'
testImplementation 'org.apache.flink:flink-streaming-java_2.11:1.14.2:tests'

参考:https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/datastream/testing/

eqoofvh9

eqoofvh92#

这对我来说很有效,我使用的是SBT,我使用的是Flink版本'1.12.2'和scalaVersion '2.12'

"org.apache.flink" %% "flink-test-utils" % flinkVersion % Test,
  "org.apache.flink" %% "flink-streaming-java" % flinkVersion % Test,
  "org.apache.flink" %% "flink-runtime" % flinkVersion % Test,
  "org.apache.flink" % "flink-test-utils-junit" % flinkVersion % Test

为了补充安德的答案,试着加上“flink-test-utils-junit”。

相关问题