sergeda
sergeda

Reputation: 2221

How to use ScalaMock not in the tests?

Is this possible to use ScalaMock stub not inside the tests but inside actual code? I want to run http service that require other service witch I want to stub for now. Can't find in documentation how this can be achieved.

Upvotes: 0

Views: 50

Answers (1)

Mateusz Kubuszok
Mateusz Kubuszok

Reputation: 27595

There shouldn't be a difference in behavior between runtime and test environment, when it comes to dependency management and bytecode. Only difference would be what dependencies are defined for each of them. I assume that simply removing Test from:

libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "3.5.0" % Test

should do the job. Personally though, I would prefer to write a stub service by hand.

Upvotes: 1

Related Questions