From 0d5d5e2502c2e20bd89a34392e9d1ddfe23c2beb Mon Sep 17 00:00:00 2001 From: Lintterer Date: Mon, 15 Jan 2024 15:15:48 +0100 Subject: [PATCH] chore: update play and play test --- project/Dependencies.scala | 6 +++--- project/plugins.sbt | 2 +- .../de/innfactory/smithy4play/SmithyPlayEndpoint.scala | 10 +++++----- smithy4playTest/app/Module.scala | 4 ++-- smithy4playTest/test/TestControllerTest.scala | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 460050b7..72fb0fe3 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -3,8 +3,8 @@ import sbt._ object Dependencies { - val playVersion = "2.9.1" - val typesafePlay = "com.typesafe.play" %% "play" % playVersion + val playVersion = "3.0.1" + val typesafePlay = "org.playframework" %% "play" % playVersion val scalaVersion = "2.13.12" val smithy4sVersion = "0.17.19" @@ -20,7 +20,7 @@ object Dependencies { "software.amazon.smithy" % "smithy-protocol-test-traits" % smithyVersion val scalatestPlus = - "org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test + "org.scalatestplus.play" %% "scalatestplus-play" % "7.0.1" % Test val cats = "org.typelevel" %% "cats-core" % "2.9.0" lazy val list = Seq( diff --git a/project/plugins.sbt b/project/plugins.sbt index 52386daf..a809cf2e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,7 @@ addSbtPlugin("com.codecommit" %% "sbt-github-packages" % "0.5.3") addSbtPlugin("org.wartremover" %% "sbt-wartremover" % "3.1.6") addSbtPlugin("org.scalameta" %% "sbt-scalafmt" % "2.5.2") addSbtPlugin("com.disneystreaming.smithy4s" %% "smithy4s-sbt-codegen" % "0.17.19") -addSbtPlugin("com.typesafe.play" %% "sbt-plugin" % "2.9.1") +addSbtPlugin("org.playframework" %% "sbt-plugin" % "3.0.1") addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "2.0.9") ThisBuild / dependencyOverrides ++= Seq( diff --git a/smithy4play/src/main/scala/de/innfactory/smithy4play/SmithyPlayEndpoint.scala b/smithy4play/src/main/scala/de/innfactory/smithy4play/SmithyPlayEndpoint.scala index 2d2c6258..e97036a5 100644 --- a/smithy4play/src/main/scala/de/innfactory/smithy4play/SmithyPlayEndpoint.scala +++ b/smithy4play/src/main/scala/de/innfactory/smithy4play/SmithyPlayEndpoint.scala @@ -1,17 +1,17 @@ package de.innfactory.smithy4play -import akka.util.ByteString -import cats.data.{ EitherT, Kleisli } +import cats.data.{EitherT, Kleisli} import cats.implicits.toBifunctorOps import de.innfactory.smithy4play import de.innfactory.smithy4play.middleware.MiddlewareBase +import org.apache.pekko.util.ByteString import play.api.mvc._ -import smithy4s.http.{ CodecAPI, HttpEndpoint, Metadata, PathParams } +import smithy4s.http.{CodecAPI, HttpEndpoint, Metadata, PathParams} import smithy4s.kinds.FunctorInterpreter import smithy4s.schema.Schema -import smithy4s.{ ByteArray, Endpoint, Service } +import smithy4s.{ByteArray, Endpoint, Service} -import scala.concurrent.{ ExecutionContext, Future } +import scala.concurrent.{ExecutionContext, Future} class SmithyPlayEndpoint[Alg[_[_, _, _, _, _]], F[_] <: ContextRoute[_], Op[ _, diff --git a/smithy4playTest/app/Module.scala b/smithy4playTest/app/Module.scala index 0c5297a7..79550275 100755 --- a/smithy4playTest/app/Module.scala +++ b/smithy4playTest/app/Module.scala @@ -1,13 +1,13 @@ import com.google.inject.AbstractModule import controller.middlewares.MiddlewareRegistry import de.innfactory.smithy4play.middleware.MiddlewareRegistryBase -import play.api.libs.concurrent.AkkaGuiceSupport +import play.api.libs.concurrent.PekkoGuiceSupport /** This module handles the bindings for the API to the Slick implementation. * * https://www.playframework.com/documentation/latest/ScalaDependencyInjection#Programmatic-bindings */ -class Module extends AbstractModule with AkkaGuiceSupport { +class Module extends AbstractModule with PekkoGuiceSupport { override def configure(): Unit = bind(classOf[MiddlewareRegistryBase]).to(classOf[MiddlewareRegistry]) diff --git a/smithy4playTest/test/TestControllerTest.scala b/smithy4playTest/test/TestControllerTest.scala index bd857297..4a745315 100644 --- a/smithy4playTest/test/TestControllerTest.scala +++ b/smithy4playTest/test/TestControllerTest.scala @@ -44,7 +44,7 @@ class TestControllerTest extends PlaySpec with BaseOneAppPerSuite with FakeAppli for { result <- res headers = result.header.headers.map(v => (v._1, Seq(v._2))) - body <- result.body.consumeData.map(_.toArrayUnsafe()) + body <- result.body.consumeData.map(_.toArray) bodyConsumed = if (result.body.isKnownEmpty) None else Some(body) contentType = result.body.contentType headersWithContentType =