喷雾testkit:找不到参数TA内含价值:(spray-testkit: could not fi

2019-10-22 01:48发布

第一次喷雾用户接近抓取头发。

trait SampleService extends SimpleRoutingApp with JsonProtocol with SprayJsonSupport {

  implicit val system: ActorSystem = ActorSystem("test")

  implicit def context: ExecutionContext = system.dispatcher

  startServer(interface = "localhost", port = 8888) {
    path("test") { _ =>
      get {
        complete {
          "test"
        }
      }
    }
  }
}

进口org.scalatest.FlatSpec进口spray.testkit.ScalatestRouteTest

class ApiSpec extends FlatSpec with ScalatestRouteTest with SampleService {

  "The api service" should "return test" in {
    Get("/test/") ~> check {
      responseAs[String] === "test"
    }
  }
}

和美妙的编译错误信息:

 could not find implicit value for parameter ta: ApiSpec.this.TildeArrow[ApiSpec.this.RouteResult,Boolean]
[error]     Get("/test/") ~> check {}

任何人都可以请点我在正确的方向? 从复制粘贴spray-testkit例子似乎失败。

文章来源: spray-testkit: could not find implicit value for parameter ta: