Skip to content

Commit

Permalink
Import needed for Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurz committed Apr 2, 2023
1 parent b58df09 commit 8d48699
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ class JavaErrorHandling extends PlaySpecification with WsTestClient {
"java error handling" should {
"allow providing a custom error handler" in new WithServer(fakeApp[javaguide.application.root.ErrorHandler]) {
override def running() = {
import play.api.libs.ws.DefaultBodyReadables.readableAsString
await(wsUrl("/error").get()).body must startWith("A server error occurred: ")
}
}

"allow providing a custom error handler" in new WithServer(fakeApp[ErrorHandler]) {
override def running() = {
import play.api.libs.ws.DefaultBodyReadables.readableAsString
(await(wsUrl("/error").get()).body must not).startWith("A server error occurred: ")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class ScalaAkkaEmbeddingPlay extends Specification with WsTestClient {
}

def testRequest(port: Int) = {
import play.api.libs.ws.DefaultBodyReadables.readableAsString
withClient { client => Await.result(client.url("/hello/world").get(), Duration.Inf).body must_== "Hello world" }(
new play.api.http.Port(port)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class ScalaNettyEmbeddingPlay extends Specification with WsTestClient {
}

def testRequest(port: Int) = {
import play.api.libs.ws.DefaultBodyReadables.readableAsString
withClient { client => Await.result(client.url("/hello/world").get(), Duration.Inf).body must_== "Hello world" }(
new play.api.http.Port(port)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ScalaErrorHandling extends PlaySpecification with WsTestClient {
"scala error handling" should {
"allow providing a custom error handler" in new WithServer(fakeApp[root.ErrorHandler]) {
override def running() = {
import play.api.libs.ws.DefaultBodyReadables.readableAsString
await(wsUrl("/error").get()).body must_== "A server error occurred: foo"
}
}
Expand Down

0 comments on commit 8d48699

Please sign in to comment.