scalamock / scalatest を使用しようとしていますが、テスト中に常にエラーが発生します
私のbuild.sbt
name := "name"
organization := "org"
version := "1.0-SNAPSHOT"
scalaVersion := "2.11.7"
scalacOptions ++= Seq("-feature", "-language:postfixOps","-language:existentials")
libraryDependencies <<= scalaVersion { scala_version =>
val sparkVersion = "1.5.1"
Seq(
"org.scalatest" %% "scalatest" % "2.2.5" % "test",
"org.scalamock" %% "scalamock-scalatest-support" % "3.2" % "test",
"junit" % "junit" % "4.11" % "test",
"org.apache.spark" %% "spark-streaming" % sparkVersion,
"org.apache.spark" %% "spark-sql" % sparkVersion,
"org.apache.spark" %% "spark-core" % sparkVersion,
"com.typesafe" % "config" % "1.3.0"
)
}
私の単体テスト:
@Test
class BWPMDAOTest extends FlatSpec with Matchers with MockFactory{
val sparkcontext = mock[SparkContext]
val dao = new BWPMDAO(sparkcontext)
dao.getStatsAsList() should not be null
dao.getStatsAsList() should not be empty
}
実行するsbt test
と、次のエラーが発生します。
Error:scalac: missing or invalid dependency detected while loading class file 'MetricsSystem.class'.
Could not access term eclipse in package org,
because it (or its dependencies) are missing. Check your build definition for
missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.)
A full rebuild may help if 'MetricsSystem.class' was compiled against an incompatible version of org.
どうすれば解決できますか?
ありがとう