0
我试图在将它放到生产服务器上后测试我的play 2.5应用程序。基本上我只想运行与生产服务器设置一起在我的ApplicationSpec.scala中编写的相同测试。我跟着文档,但无法创建应用程序实例:如何编写生产服务器测试与OneServerPerSuite一起玩
import play.api.test.Helpers.{GET => GET_REQUEST, _}
import play.api.test._
class ProductionSpec extends PlaySpec with OneServerPerSuite {
implicit override lazy val app =
new GuiceApplicationBuilder().disable[EhCacheModule].router(Router.from {
case GET(p"/") => Action { play.api.mvc.Results.Ok("ok") }
}).build()
"AuthController" should {
"initialize tables" in {
val init = route(app, FakeRequest(GET, "/init")).get
status(init) mustBe OK
}
}
}
误差
ProductionSpec.scala:25: not found: value GET
...
ProductionSpec.scala:25: value p is not a member of StringContext
如何测试应用程序的生产环境中运行?