Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.18 KB

File metadata and controls

43 lines (34 loc) · 1.18 KB

embedded-mongodb

Maven dependency

pom.xml
<dependency>
    <groupId>com.playtika.testcontainers</groupId>
    <artifactId>embedded-mongodb</artifactId>
    <scope>test</scope>
</dependency>

Consumes (via bootstrap.properties)

  • embedded.mongodb.enabled (true|false, default is true)

  • embedded.mongodb.reuseContainer (true|false, default is false)

  • embedded.mongodb.dockerImage (default is 'mongo:5.0-focal')

  • embedded.mongodb.host (default is localhost)

  • embedded.mongodb.port (default is 27017)

  • embedded.mongodb.username

  • embedded.mongodb.password

  • embedded.mongodb.database (default is test)

Produces

  • embedded.mongodb.host

  • embedded.mongodb.port

  • embedded.mongodb.username

  • embedded.mongodb.password

  • embedded.mongodb.database

Example

To auto-configure spring-data-mongodb use these properties in your test application.properties:

/src/test/resources/application.properties
spring.data.mongodb.uri=mongodb://${embedded.mongodb.host}:${embedded.mongodb.port}/${embedded.mongodb.database}