diff --git a/play-scala-chatroom-example/test/controllers/HomeControllerSpec.scala b/play-scala-chatroom-example/test/controllers/HomeControllerSpec.scala index b93b07bbb..445cc16c5 100644 --- a/play-scala-chatroom-example/test/controllers/HomeControllerSpec.scala +++ b/play-scala-chatroom-example/test/controllers/HomeControllerSpec.scala @@ -10,7 +10,7 @@ import play.api.test._ import play.shaded.ahc.org.asynchttpclient.AsyncHttpClient import play.shaded.ahc.org.asynchttpclient.ws.WebSocket -import scala.compat.java8.FutureConverters +import scala.jdk.javaapi.FutureConverters import scala.concurrent.Await import scala.concurrent.duration._ import scala.language.postfixOps @@ -35,7 +35,7 @@ class HomeControllerSpec extends PlaySpec with ScalaFutures with IntegrationPati val origin = "ws://example.com/ws/chat" val listener = new WebSocketClient.LoggingListener val completionStage = webSocketClient.call(serverURL, origin, listener) - val f = FutureConverters.toScala(completionStage) + val f = FutureConverters.asScala(completionStage) Await.result(f, atMost = 1000 millis) listener.getThrowable mustBe a[IOException] } catch { @@ -63,7 +63,7 @@ class HomeControllerSpec extends PlaySpec with ScalaFutures with IntegrationPati val origin = serverURL val listener = new WebSocketClient.LoggingListener val completionStage = webSocketClient.call(serverURL, origin, listener) - val f = FutureConverters.toScala(completionStage) + val f = FutureConverters.asScala(completionStage) whenReady(f, timeout = Timeout(1 second)) { webSocket => webSocket mustBe a [WebSocket] diff --git a/play-scala-websocket-example/test/controllers/FunctionalSpec.scala b/play-scala-websocket-example/test/controllers/FunctionalSpec.scala index ce71b4cc1..659ca0b01 100644 --- a/play-scala-websocket-example/test/controllers/FunctionalSpec.scala +++ b/play-scala-websocket-example/test/controllers/FunctionalSpec.scala @@ -13,7 +13,7 @@ import play.api.test.{Helpers, TestServer, WsTestClient} import org.awaitility.Awaitility._ import play.api.libs.json._ -import scala.compat.java8.FutureConverters +import scala.jdk.javaapi.FutureConverters import scala.concurrent.Await import scala.concurrent.duration._ @@ -39,7 +39,7 @@ class FunctionalSpec extends PlaySpec with ScalaFutures { } val listener = new WebSocketClient.LoggingListener(consumer) val completionStage = webSocketClient.call(serverURL, origin, listener) - val f = FutureConverters.toScala(completionStage) + val f = FutureConverters.asScala(completionStage) Await.result(f, atMost = 1000.millis) listener.getThrowable.printStackTrace() listener.getThrowable mustBe a[IOException] @@ -70,7 +70,7 @@ class FunctionalSpec extends PlaySpec with ScalaFutures { } val listener = new WebSocketClient.LoggingListener(consumer) val completionStage = webSocketClient.call(serverURL, origin, listener) - val f = FutureConverters.toScala(completionStage) + val f = FutureConverters.asScala(completionStage) // Test we can get good output from the websocket whenReady(f, timeout = Timeout(1.second)) { webSocket =>