Akka http get route


(Bhgitgit) #1

Hi,

I am developing a akka http based webservice using directives. When I run the unit test for the get I have implemented, the get directive path matches but the message send(below is the code):
case GetUser(userId) =>
val user = users.find(_.id==userId)
sender()! user

to actor does not seem to work which is failing the test with:
Request was rejected
ScalaTestFailureLocation: com.example.UserRoutesSpec at (UserRoutesSpec.scala:74)
org.scalatest.exceptions.TestFailedException: Request was rejected
at akka.http.scaladsl.testkit.TestFrameworkInterface$Scalatest.failTest(TestFrameworkInterface.scala:24)
at akka.http.scaladsl.testkit.TestFrameworkInterface$Scalatest.failTest$(TestFrameworkInterface.scala:24)

pls can you let me know reasons it could be failing.

Thanks