Back to Testcontainers Java

MinIO Containers

docs/modules/minio.md

2.0.51.4 KB
Original Source

MinIO Containers

Testcontainers can be used to automatically instantiate and manage MinIO containers.

Usage example

Create a MinIOContainer to use it in your tests:

<!--codeinclude-->

Starting a MinIO container inside_block:minioContainer

<!--/codeinclude-->

The MinIO Java client can be configured with the container as such:

<!--codeinclude-->

Configuring a MinIO client inside_block:configuringClient

<!--/codeinclude-->

If needed the username and password can be overridden as such:

<!--codeinclude-->

Overriding a MinIO container inside_block:minioOverrides

<!--/codeinclude-->

Adding this module to your project dependencies

Add the following dependency to your pom.xml/build.gradle file:

=== "Gradle" groovy testImplementation "org.testcontainers:testcontainers-minio:{{latest_version}}"

=== "Maven" xml <dependency> <groupId>org.testcontainers</groupId> <artifactId>testcontainers-minio</artifactId> <version>{{latest_version}}</version> <scope>test</scope> </dependency>