com.dimafeng.testcontainers.NginxContainer.scala Maven / Gradle / Ivy
The newest version!
package com.dimafeng.testcontainers
import java.net.URL
import org.testcontainers.containers.{NginxContainer => JavaNginxContainer}
case class NginxContainer(
customContent: Option[String] = None
) extends SingleContainer[JavaNginxContainer[_]] {
override val container: JavaNginxContainer[_] = {
val c: JavaNginxContainer[_] = new JavaNginxContainer()
customContent.foreach(c.withCustomContent)
c
}
def baseUrl(scheme: String, port: Int): URL = container.getBaseUrl(scheme, port)
}
object NginxContainer {
case class Def(
customContent: Option[String] = None
) extends ContainerDef {
override type Container = NginxContainer
override def createContainer(): NginxContainer = {
new NginxContainer(
customContent
)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy