Akka comes with a dedicated module akka-testkit for supporting tests at different levels.
Questions tagged [akka-testkit]
140 questions
0
votes
1 answer
Actor not catching exception in Test even if thrown
My Actor looks like
object LogProcessorActor {
def props(f: () => Unit): Props = Props(new LogProcessorActor(f))
}
class LogProcessorActor(f: () => Unit) extends Actor with ActorLogging {
def receive = LoggingReceive {
case…

daydreamer
- 87,243
- 191
- 450
- 722
0
votes
1 answer
How to mock using external call in Akka Actor using ScalaTest
I am new to entire ecosystem including Scala, Akka and ScalaTest
I am working on a problem where my Actor gives call to external system.
case object LogProcessRequest
class LProcessor extends Actor {
val log = Logging(context.system, this)
…

daydreamer
- 87,243
- 191
- 450
- 722
0
votes
1 answer
Akka's TestProbe expectMsg to match if expected message is among sent
I have a test for particular actor. This actor depends on some other actors, so I use TestProbe() to test in isolation.
My problem is, that I receive more messages then I am interested in testing at this very particular test. For example:
val a =…

M4ks
- 11,744
- 7
- 27
- 48
0
votes
1 answer
Akka FSM and TestKit putting shared tests into Trait makes sender be deadLetters
I am trying to factor some common tests of some common Akka FSM code into a trait but the sender ref is becoming deadLetters. Using this FSM code:
import akka.actor.FSM
import akka.testkit.TestFSMRef
import akka.testkit.TestKit
import…

simbo1905
- 6,321
- 5
- 58
- 86
-1
votes
1 answer
Validating more than one message returned from the actor
An akka-testkit question.
Could some one advise on how do I validate that actor 'A' when received message x, has responded with two messages - y and z.
Messages x,y,z are all of different types.
I don't see any suitable 'expect*' function that…

Eli Golin
- 373
- 1
- 16