I have the following test case:
class MutableStateActorTest extends TestKit(ActorSystem("MutableStateActorTest")) with WordSpecLike with Matchers {
"A MutableStateActor" must {
val actRef = TestActorRef[MutableStateActor]
"mutate state in order" in {
1 to 5 foreach {
x => actRef ! Increment
}
}
}
}
It can't be simpler that that, but I get the following error when I tried to run it:
An exception or error caused a run to abort: Found class akka.actor.ActorPath, but interface was expected
java.lang.IncompatibleClassChangeError: Found class akka.actor.ActorPath, but interface was expected
at akka.testkit.TestActorRef.<init>(TestActorRef.scala:47)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:141)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:137)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:146)
at akka.testkit.TestActorRef$.apply(TestActorRef.scala:144)
at q31.sandbox.statetest.MutableStateActorTest$$anonfun$1.apply$mcV$sp(MutableStateActorTest.scala:16)
at q31.sandbox.statetest.MutableStateActorTest$$anonfun$1.apply(MutableStateActorTest.scala:14)
at q31.sandbox.statetest.MutableStateActorTest$$anonfun$1.apply(MutableStateActorTest.scala:14)
I guess it has got something to do with Actor References?