Skip to content

mylife1984/embedded-mongodb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central Build Status

embedded-mongodb

Embedded MongoDB for unit testing and developement purposes. Based on flapdoodle-oss/de.flapdoodle.embed.mongo

Requires Java 11.

Usage

  1. Add the embedded-mongodb dependency to your pom.xml:
	<dependency>
		<groupId>de.svenkubiak</groupId>
		<artifactId>embedded-mongodb</artifactId>
		<version>x.x.x</version>
	</dependency>
  1. Start the embedded MongoDB by calling the following method
	EmbeddedMongoDB.create().start();

This will start an in-memory MongoDB with default options at localhost on port 29019 with the latest "production" version of Mongo DB.

Additional options

EmbeddedMongoDB embeddedMongoDB = EmbeddedMongoDB.create()
    .withHost("localhost")
    .withPort(27017)
    .withVersion(Main.V3_6)
    .start();
    
if (embeddedMongoDB.isActive()) {
	//do something
}

About

Embedded MongoDB for unit testing purposes based on flapdoodle-oss/de.flapdoodle.embed.mongo

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%