Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.2 KB

File metadata and controls

43 lines (34 loc) · 1.2 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 set to 'mongo:4.2.0-bionic')

  • 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}