My build.sbt file looks as follows
name := "cakepattern"
version := "0.1"
scalaVersion := "2.11.8"
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.0" % "test",
"org.scalamock" %% "scalamock-core" % "3.1.1" % "test",
"org.scalamock" %% "scalamock-scalatest-support" % "3.1.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.13.0" % "test",
"org.mockito" % "mockito-all" % "1.10.19"
)
And my scalatest class looks as follows
package services
import config.MockAuthServiceComponent
import dto.{Tweet, User}
import org.scalamock.scalatest.MockFactory
import org.scalatest.{FlatSpec, OneInstancePerTest, Outcome}
import org.scalatest.matchers.MatchResult
import services.impl.DefaultTweetServiceComponent
class DefaultTweetServiceComponentTest extends FlatSpec with MockFactory with OneInstancePerTest{
val tweetServiceComponent = new DefaultTweetServiceComponent with MockAuthServiceComponent {
override val tweetService = DefaultTweetService
}
}
When I try to do sbt test:compile I get the following error
Error:scalac: missing or invalid dependency detected while loading class file 'AbstractMockFactory.class'.
Could not access type NoArgTest in trait org.scalatest.Suite,
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 'AbstractMockFactory.class' was compiled against an incompatible version of org.scalatest.Suite.
The error seems to go away when I take out MockFactory. Please help, what am I missing.
Thanks!