Akka Getting Started Tutorial


(João Pedro Evangelista) #1

Hi Guys!

I’m doing the Tutorial of the Getting Started section on Akka’s documentation, it is all good and incredible well written, but in part 3 when we starting writing tests, I sense a lack of information on where to get the implicit system (ActorSystem) or how to setup the ScalaTest to use Akka Testkit.

Would be possible to improve the code on the documentation or at least in case it becomes bigger and optionated over the test suite used, we could point the user to Testkit Docs where it has already an example with ScalaTest ?


(Johan Andrén) #2

Did you start with downloading the sample project as described in the introduction to the getting started? https://doc.akka.io/docs/akka/current/guide/introduction.html?language=scala#how-to-get-started

That should contain complete tests using Scalatest that you can base your tests on.
(We discussed exactly this recently in an issue, but now I can’t find it)


(João Pedro Evangelista) #3

Yes I did! But I deleted the test without looking at it first, so really my bad, sorry. So I downloaded it again, seems good to get started and after getting experience on Scalatest one can refine their tests. I could find information that a I needed looking on the documentation :smile:


(Johan Andrén) #4

I created an issue to track adding something clarifying this next to the first test sample: https://github.com/akka/akka/issues/25193


(olib) #5

I had the same issue.

Also I opened the “source link” which took me to this page: https://github.com/akka/akka/tree/v2.5.18/akka-docs/src/test/scala/tutorial_3/DeviceSpec.scala#L16-L24

with the appropriate code snippet. But this DeviceSpec.scala files uses somehow this “AkkaSpec” object which is not available in a newly setup project. This was a bit misleading. As I have seen this “AkkaSpec” object is only available in the test folder of the akka-testkit module.

I think it makes sense to point there to the official testing doc: https://doc.akka.io/docs/akka/2.5/testing.html and also refer back to the Quickstart sample project.

Thanks @johanandren for creating the issue in Github.


(olib) #6

Have added a first PR here: https://github.com/akka/akka/pull/25928