I am, again, struggling with spray and cannot set up a test correctly. I looked at the similar question spray-testkit: could not find implicit value for parameter ta: and the official spray template and cannot figure out what I am missing and/or doing wrong.
I have a very simple service:
trait SimpleService extends HttpService{
val fooRoute = path("foo") {
get {
complete("bar")
}
}
}
And I have a very simple test:
class SimpleServiceTest extends FlatSpec with Matchers with SimpleService with ScalatestRouteTest {
override implicit def actorRefFactory: ActorRefFactory = system
"The service" should "return OK status when getting /foo" in {
Get("/foo") ~> fooRoute ~> check {
status should be(OK)
}
}
}
when I try to compile this, I get the following error:
Error:(17, 17) could not find implicit value for parameter ta: SimpleServiceTest.this.TildeArrow[spray.routing.RequestContext,Unit]
Get("/foo") ~> fooRoute ~> check {
^
Can anyone help me and tell me what I am missing? I do not find anything unusual, and I am close to evaluating Play instead of spray.