diff --git a/akka-docs/rst/java/testing.rst b/akka-docs/rst/java/testing.rst index f3ce9f5d16..5f90792f93 100644 --- a/akka-docs/rst/java/testing.rst +++ b/akka-docs/rst/java/testing.rst @@ -65,6 +65,16 @@ obtaining a reference to the underlying actor instance, or by invoking or querying the actor's behaviour (:meth:`receive`). Each one warrants its own section below. +.. note:: + It is highly recommended to stick to traditional behavioural testing (using messaging + to ask the Actor to reply with the state you want to run assertions against), + instead of using ``TestActorRef`` whenever possible. + + Due to the synchronous nature of ``TestActorRef`` it will **not** work with some support + traits that Akka provides as they require asynchronous behaviours to function properly. + Examples of traits that do not mix well with test actor refs are :ref:`PersistentActor ` + and :ref:`AtLeastOnceDelivery ` provided by :ref:`Akka Persistence `. + Obtaining a Reference to an :class:`Actor` ------------------------------------------ diff --git a/akka-docs/rst/scala/testing.rst b/akka-docs/rst/scala/testing.rst index ba80574bcf..9182ddd9ee 100644 --- a/akka-docs/rst/scala/testing.rst +++ b/akka-docs/rst/scala/testing.rst @@ -54,6 +54,16 @@ obtaining a reference to the underlying actor instance, or by invoking or querying the actor's behaviour (:meth:`receive`). Each one warrants its own section below. +.. note:: + It is highly recommended to stick to traditional behavioural testing (using messaging + to ask the Actor to reply with the state you want to run assertions against), + instead of using ``TestActorRef`` whenever possible. + + Due to the synchronous nature of ``TestActorRef`` it will **not** work with some support + traits that Akka provides as they require asynchronous behaviours to function properly. + Examples of traits that do not mix well with test actor refs are :ref:`PersistentActor ` + and :ref:`AtLeastOnceDelivery ` provided by :ref:`Akka Persistence `. + Obtaining a Reference to an :class:`Actor` ------------------------------------------