From 33673b272985e53083c253185d6f9eb1d2412523 Mon Sep 17 00:00:00 2001 From: Ivan Klass Date: Mon, 25 Nov 2024 13:53:18 +0100 Subject: [PATCH] Fix more test.Port vs ip4s.Port collisions --- .../src/main/scala/sttp/tapir/client/tests/HttpServer.scala | 3 ++- .../sttp/tapir/swagger/bundle/SwaggerInterpreterTest.scala | 1 + perf-tests/src/main/scala/sttp/tapir/perf/http4s/Http4s.scala | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/testserver/src/main/scala/sttp/tapir/client/tests/HttpServer.scala b/client/testserver/src/main/scala/sttp/tapir/client/tests/HttpServer.scala index f9cbb4da48..5b083ebf36 100644 --- a/client/testserver/src/main/scala/sttp/tapir/client/tests/HttpServer.scala +++ b/client/testserver/src/main/scala/sttp/tapir/client/tests/HttpServer.scala @@ -3,6 +3,7 @@ package sttp.tapir.client.tests import cats.effect._ import cats.effect.std.Queue import cats.effect.unsafe.implicits.global +import com.comcast.ip4s import cats.implicits._ import fs2.{Pipe, Stream} import org.http4s.dsl.io._ @@ -215,7 +216,7 @@ class HttpServer(port: Port) { def start(): Unit = { val (_, _stopServer) = EmberServerBuilder .default[IO] - .withPort(port) + .withPort(ip4s.Port.fromInt(port).get) .withHttpWebSocketApp(app) .build .allocated diff --git a/docs/swagger-ui-bundle/src/test/scala/sttp/tapir/swagger/bundle/SwaggerInterpreterTest.scala b/docs/swagger-ui-bundle/src/test/scala/sttp/tapir/swagger/bundle/SwaggerInterpreterTest.scala index aa319bfaf1..a1b984ca8b 100644 --- a/docs/swagger-ui-bundle/src/test/scala/sttp/tapir/swagger/bundle/SwaggerInterpreterTest.scala +++ b/docs/swagger-ui-bundle/src/test/scala/sttp/tapir/swagger/bundle/SwaggerInterpreterTest.scala @@ -2,6 +2,7 @@ package sttp.tapir.swagger.bundle import cats.effect.IO import cats.effect.unsafe.implicits.global +import com.comcast.ip4s.Port import org.http4s.HttpRoutes import org.http4s.ember.server.EmberServerBuilder import org.http4s.server.Router diff --git a/perf-tests/src/main/scala/sttp/tapir/perf/http4s/Http4s.scala b/perf-tests/src/main/scala/sttp/tapir/perf/http4s/Http4s.scala index da5e14ab32..7187737569 100644 --- a/perf-tests/src/main/scala/sttp/tapir/perf/http4s/Http4s.scala +++ b/perf-tests/src/main/scala/sttp/tapir/perf/http4s/Http4s.scala @@ -2,6 +2,7 @@ package sttp.tapir.perf.http4s import cats.effect._ import cats.syntax.all._ +import com.comcast.ip4s import fs2._ import fs2.io.file.{Files, Path => Fs2Path} import org.http4s._ @@ -111,7 +112,7 @@ object server { ): IO[ServerRunner.KillSwitch] = EmberServerBuilder .default[IO] - .withPort(Port) + .withPort(ip4s.Port.fromInt(Port).get) .withHttpWebSocketApp(wsb => router(wsb).orNotFound) .withMaxConnections(maxConnections) .withConnectorPoolSize(connectorPoolSize)