Skip to content

Files

Latest commit

ff7dcba · Aug 31, 2020

History

History
This branch is 3 commits ahead of, 1408 commits behind PlaytikaOSS/testcontainers-spring-boot:develop.

embedded-mongodb

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 26, 2020
Jun 26, 2020
Aug 31, 2020

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}