From d1849417b178073ec51a989de7751fc1c3dd26ce Mon Sep 17 00:00:00 2001 From: Matthias Berndt Date: Mon, 4 Mar 2024 12:46:15 +0100 Subject: [PATCH] add firstMappedPort method --- core/src/main/scala/com/dimafeng/testcontainers/Container.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/scala/com/dimafeng/testcontainers/Container.scala b/core/src/main/scala/com/dimafeng/testcontainers/Container.scala index b3a5d40e..4ddf2bb5 100644 --- a/core/src/main/scala/com/dimafeng/testcontainers/Container.scala +++ b/core/src/main/scala/com/dimafeng/testcontainers/Container.scala @@ -84,6 +84,8 @@ abstract class SingleContainer[T <: JavaGenericContainer[_]] extends TestContain def mappedPort(port: Int): Int = container.getMappedPort(port) + def firstMappedPort: Int = container.getFirstMappedPort() + def portBindings: Seq[String] = container.getPortBindings.asScala.toSeq def boundPortNumbers: Seq[Int] = container.getBoundPortNumbers.asScala.toSeq.map(_.intValue())