Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumps testcontainers-java to 1.19.1 and adds in MinIO #265

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ lazy val root = (project in file("."))
moduleSolr,
moduleGcloud,
moduleRedpanda,
moduleMinIO,
allOld
)
.settings(noPublishSettings)
Expand Down Expand Up @@ -489,3 +490,11 @@ lazy val moduleRedpanda = (project in file("modules/redpanda"))
name := "testcontainers-scala-redpanda",
libraryDependencies ++= Dependencies.moduleRedpanda.value
)

lazy val moduleMinIO = (project in file("modules/minio"))
.dependsOn(core % "compile->compile;test->test;provided->provided", scalatest % "test->test")
.settings(commonSettings)
.settings(
name := "testcontainers-scala-minio",
libraryDependencies ++= Dependencies.moduleMinIO.value
)
1 change: 1 addition & 0 deletions docs/src/main/tut/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Here is the full list of the [currently available modules](https://github.com/te
* `testcontainers-scala-mongodb` — module with the MongoDB container.
* `testcontainers-scala-solr` — module with the Solr container.
* `testcontainers-scala-gcloud` — module with the Bigtable, Firebase and PubSub emulator containers.
* `testcontainers-scala-minio` — module with MinIO container.

Most of the modules are just proxies to the testcontainers-java modules and behave exactly like java containers.
You can find documentation about them in the [testcontainers-java docs pages](https://www.testcontainers.org/).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.dimafeng.testcontainers

import org.testcontainers.containers.{MinIOContainer => JavaMinIOContainer}
import org.testcontainers.utility.DockerImageName

case class MinIOContainer(
dockerImageName: DockerImageName = DockerImageName.parse(MinIOContainer.defaultDockerImageName),
userName: String = MinIOContainer.defaultUserName,
password: String = MinIOContainer.defaultPassword
) extends SingleContainer[JavaMinIOContainer] {

override val container: JavaMinIOContainer = {
val c = new JavaMinIOContainer(dockerImageName)
c.withUserName(userName)
c.withPassword(password)
c
}

def s3URL: String = container.getS3URL()
}

object MinIOContainer {

val defaultImage = "minio/minio"
val defaultTag = "RELEASE.2023-09-04T19-57-37Z"
val defaultDockerImageName = s"$defaultImage:$defaultTag"

val defaultUserName = "miniouser"
val defaultPassword = "miniopassword"

case class Def(dockerImageName: DockerImageName = DockerImageName.parse(MinIOContainer.defaultDockerImageName),
userName: String = MinIOContainer.defaultUserName, password: String = MinIOContainer.defaultPassword) extends ContainerDef {
override type Container = MinIOContainer

override def createContainer(): MinIOContainer = {
new MinIOContainer(dockerImageName, userName, password)
}
}
}
8 changes: 7 additions & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object Dependencies {
scope.map(s => modules.map(_ % s)).getOrElse(modules)
}

private val testcontainersVersion = "1.19.0"
private val testcontainersVersion = "1.19.1"
private val seleniumVersion = "2.53.1"
private val slf4jVersion = "1.7.32"
private val scalaTestVersion = "3.2.9"
Expand Down Expand Up @@ -304,4 +304,10 @@ object Dependencies {
"org.apache.kafka" % "kafka-clients" % kafkaDriverVersion
)
)

val moduleMinIO = Def.setting(
COMPILE(
"org.testcontainers" % "minio" % testcontainersVersion
)
)
}
Loading