I'm using "scalatestplus-play" % "5.1.0", and I'm trying to bring MockitoSugar to my class like I did in earlier projects:
class MyTestSpec extends AnyFreeSpec with MockitoSugar
so I can use the mock[MyClass] function and now it docent exists, can't find in the documentation something else.
in my earlier projects I used "scalatestplus-play" % "4.0.3", I'm sure there is a different way now but can't find what it is
First option you have, is to use scalatestplus-mockito, where you can find
MockitoSugar, as you are used to.From ScalaTest Testing with mock objects:
Another option, as said in the attached link, there are 4 libraries that can be used. The easiest one in my opinion is
ScalaMock. To use it you need to extendMockFactory.It should be imported from:
The difference is that
"scalatestplus-play" % "4.0.3"depends on ScalaTest version 3.0.8 which still hadMockitoSugar."scalatestplus-play" % "5.1.0"depends on ScalaTest 3.1.1 which no longer has it.