Changed greeting to acknowledge instead of stringing

parent 4604e291
package no.nsd.akkapres.greeting
import akka.actor.Actor
import akka.actor.{ActorLogging, Actor}
case class Greeting(message: String)
case class Reply(acknowledge: String)
case object Acknowledge
/**
* Hello world.
* Actor accepts a greeting message, and in return it
* acknowledge that it received the message.
*/
class GreeterResponseActor extends Actor {
class GreeterResponseActor extends Actor with ActorLogging {
def receive = {
case Greeting(message) =>
sender() ! Reply(message + " world!")
log.info(message)
sender() ! Acknowledge
}
}
......@@ -23,7 +23,7 @@ class GreeterResponseActorActorTest
"Respond with an acknowledgement" in {
within(500 millis) {
greeterResponseActor ! Greeting("Hello")
expectMsg(Reply("Hello world!"))
expectMsg(Acknowledge)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment