From 717a2745d0606086a3617c498628a884dfb032b6 Mon Sep 17 00:00:00 2001 From: Ivan Topolnjak Date: Wed, 7 Aug 2024 11:43:57 +0200 Subject: [PATCH] use the appropriate container host when using mockserver --- .../kamon/instrumentation/apache/cxf/client/MessageSpec.scala | 3 ++- .../instrumentation/apache/httpclient/HttpRequestSpec.scala | 3 ++- .../instrumentation/apache/httpclient/HttpUriRequestSpec.scala | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/instrumentation/kamon-apache-cxf/src/test/scala/kamon/instrumentation/apache/cxf/client/MessageSpec.scala b/instrumentation/kamon-apache-cxf/src/test/scala/kamon/instrumentation/apache/cxf/client/MessageSpec.scala index 9ddf9c379..613a64ef8 100644 --- a/instrumentation/kamon-apache-cxf/src/test/scala/kamon/instrumentation/apache/cxf/client/MessageSpec.scala +++ b/instrumentation/kamon-apache-cxf/src/test/scala/kamon/instrumentation/apache/cxf/client/MessageSpec.scala @@ -91,7 +91,8 @@ class MessageSpec } override val container: MockServerContainer = MockServerContainer() - lazy val clientExpectation: MockServerExpectations = new MockServerExpectations("localhost", container.serverPort) + lazy val clientExpectation: MockServerExpectations = + new MockServerExpectations(container.container.getHost, container.serverPort) override protected def beforeAll(): Unit = { super.beforeAll() diff --git a/instrumentation/kamon-apache-httpclient/src/test/scala/kamon/instrumentation/apache/httpclient/HttpRequestSpec.scala b/instrumentation/kamon-apache-httpclient/src/test/scala/kamon/instrumentation/apache/httpclient/HttpRequestSpec.scala index 729d65e58..3a221deb6 100644 --- a/instrumentation/kamon-apache-httpclient/src/test/scala/kamon/instrumentation/apache/httpclient/HttpRequestSpec.scala +++ b/instrumentation/kamon-apache-httpclient/src/test/scala/kamon/instrumentation/apache/httpclient/HttpRequestSpec.scala @@ -161,7 +161,8 @@ class HttpRequestSpec } override val container: MockServerContainer = MockServerContainer() - lazy val clientExpectation: MockServerExpectations = new MockServerExpectations("localhost", container.serverPort) + lazy val clientExpectation: MockServerExpectations = + new MockServerExpectations(container.container.getHost, container.serverPort) override protected def beforeAll(): Unit = { super.beforeAll() diff --git a/instrumentation/kamon-apache-httpclient/src/test/scala/kamon/instrumentation/apache/httpclient/HttpUriRequestSpec.scala b/instrumentation/kamon-apache-httpclient/src/test/scala/kamon/instrumentation/apache/httpclient/HttpUriRequestSpec.scala index 1eadbed25..a0daa250d 100644 --- a/instrumentation/kamon-apache-httpclient/src/test/scala/kamon/instrumentation/apache/httpclient/HttpUriRequestSpec.scala +++ b/instrumentation/kamon-apache-httpclient/src/test/scala/kamon/instrumentation/apache/httpclient/HttpUriRequestSpec.scala @@ -156,7 +156,8 @@ class HttpUriRequestSpec } override val container: MockServerContainer = MockServerContainer() - lazy val clientExpectation: MockServerExpectations = new MockServerExpectations("localhost", container.serverPort) + lazy val clientExpectation: MockServerExpectations = + new MockServerExpectations(container.container.getHost, container.serverPort) override protected def beforeAll(): Unit = { super.beforeAll()