/de.flapdoodle.embed.mongo

...will provide a platform neutral way for running mongodb in unittests.

Primary LanguageJavaApache License 2.0Apache-2.0

Build Status Maven Central

Make Peace, No War!

Organization Flapdoodle OSS

We are a github organization. You are invited to participate. Every version < 4.x.x is considered as legacy.

Embedded MongoDB

Embedded MongoDB will provide a platform neutral way for running mongodb in unittests.

Why?

  • dropping databases causing some pains (often you have to wait long time after each test)
  • its easy, much easier as installing right version by hand
  • you can change version per test

How?

  • download mongodb (and cache it)
  • extract it (and cache it)
  • java uses its process api to start and monitor the mongo process
  • you run your tests
  • java kills the mongo process

License

We use http://www.apache.org/licenses/LICENSE-2.0

Dependencies

Build on top of

Other ways to use Embedded MongoDB

Howto

Usage

Maven

<dependency>
	<groupId>de.flapdoodle.embed</groupId>
	<artifactId>de.flapdoodle.embed.mongo</artifactId>
	<version>4.3.3</version>
</dependency>

Spring Integration

As the spring projects removed the embed mongo support in 2.7.0 you should consider to use one of these integration projects. It should behave mostly like the original spring integration, but there are some minor differences:

  • version in 'spring.mongodb.embedded.version' is used in package resolver and is not matched against version enum.
  • 'spring.mongodb.embedded.features' is not supported (not the way to change the config of mongodb)

If you have any trouble in using them fell free to create an issue.

Changelog

Changelog