Hello everyone,

I am having a class that extends akka.typed.scaladsl.Actor.MutableBehavior 
as follows:

class Container(ctx: ActorContext[ContainerMsg]) extends 
MutableBehavior[ContainerMsg] {


      def someMethod() = {

          some code ...

          ctx.self.toUntyped

      }

}




While writing test for "someMethod" of "Container" with 


val system: ActorSystem[Nothing]    = ActorSystem(Actor.empty, 
"container-system")

val ctx = new StubbedActorContext[ContainerMsg]("test-container", 100, 
system)

val container = new Container(ctx)

container.someMethod() shouldBe something


it throws an exception of 

only adapted untyped ActorRefs permissible


because the "ctx" in "Container" is not created using 
"akka.actor.ActorSystem". Is there any work around for this in 
akka.typed.testkit?


-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to