springtainer / springtainer-mongodb

MongoDB as docker-container for springboot testing
MIT License
5 stars 3 forks source link
mongodb spring spring-boot testcontainers testing

springtainer-mongodb

Maven Central Build Nightly build Coverage report Quality Gate Technical dept

Dependency


<dependency>
  <groupId>com.avides.springboot.springtainer</groupId>
  <artifactId>springtainer-mongodb</artifactId>
  <version>1.4.0</version>
  <scope>test</scope>
</dependency>

Configuration

Properties consumed (in bootstrap.properties):

Properties provided (in application-it.properties):

Example for minimal configuration in application-it.properties:

spring.data.mongodb.uri=mongodb://${embedded.container.mongodb.host}:${embedded.container.mongodb.port}/test

Logging

To reduce logging insert this into the logback-configuration:

<!-- Springtainer -->
<logger name="com.github.dockerjava.jaxrs" level="WARN" />
<logger name="com.github.dockerjava.core.command" level="WARN" />
<logger name="org.apache.http" level="WARN" />

Labels

The container exports multiple labels to analyze running springtainers: