I think it will be difficult to support the ordinary scheduler in
BehaviorTestKit but perhaps we could use the manual scheduler:
https://doc.akka.io/docs/akka/current/typed/testing.html#controlling-the-scheduler

Please create an issue at https://github.com/akka/akka/issues/new

Thanks,
Patrik

On Thu, Mar 8, 2018 at 7:23 AM, <dol...@thoughtworks.com> wrote:

> Hi,
>
> We are trying to create a BehaviorTestKit using a behavior which spawns a
> timer within.
>
> val behaviorTestKit = BehaviorTestKit(createBehavior)
>
>
> private def createBehavior(): Behavior[MyMessage] = {
>   Behaviors
>     .withTimers[MyMessage](
>       timerScheduler ⇒
>         Behaviors
>           .mutable[MyMessage](
>             ctx =>
>               new MyBehavior(
>                 ctx,
>                 timerScheduler,
>                 someInfo
>             )
>         )
>     )
> }
>
>
> The above code results in error below:
>
> An exception or error caused a run to abort: no scheduler
> java.lang.UnsupportedOperationException: no scheduler
>
> *spawn *provided in ActorTestKit works fine in spawning an actor for this
> behavior.
>
> However, we need to test the underlying effects of the given behavior and
> hence need to use BehaviorTestKit.
> Could someone please provide a solution to this problem?
>
> Thanks and Regards,
> Dolly
> ThoughtWorks
>
> --
> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Akka Tech Lead
Lightbend <http://www.lightbend.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
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