From 39c6238e9ccac4627b864f623b2461387ba5403f Mon Sep 17 00:00:00 2001 From: Marc Karassev Date: Wed, 5 Aug 2020 12:16:30 +0200 Subject: [PATCH] Logged real port used by S3Mock When given `port = 0`, akka-http will try to find an available port by itself, so the passed `port` parameter will not always be the one really used. --- src/main/scala/io/findify/s3mock/S3Mock.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/io/findify/s3mock/S3Mock.scala b/src/main/scala/io/findify/s3mock/S3Mock.scala index 86fc07f..7aa6e19 100644 --- a/src/main/scala/io/findify/s3mock/S3Mock.scala +++ b/src/main/scala/io/findify/s3mock/S3Mock.scala @@ -63,7 +63,7 @@ class S3Mock(port:Int, provider:Provider)(implicit system:ActorSystem = ActorSys } bind = Await.result(http.bindAndHandle(route, "0.0.0.0", port), Duration.Inf) - logger.info(s"bound to 0.0.0.0:$port") + logger.info(s"bound to 0.0.0.0:${bind.localAddress.getPort}") bind }