Writing Java Integration Tests for MongoDB

MongoDB is matured, document-oriented, cross-platform NoSQL database system with drivers available for a bunch of different programming languages. In the following short examples I’m going to write some integration tests for MongoDB using the MongoDB Java driver and the Flapdoodle library to create an embedded MongoDB instance for testing. We’re going to write tests for a simple persist-and-query scenarion and for a map-reduce function and in addition I’m going to show how to bind the start and stop of a MongoDB instance to a Maven goal using the embedmongo-maven-plugin. ...

October 16, 2013 · 8 min · 1585 words · Micha Kops