title: Embedded MongoDB when running integration tests
body: <p>My question is a variation of <a href="https://stackoverflow.com/questions/3859109/integration-tests-with-mongodb">this one</a>.</p>
  
  <p>Since my Java Web-app project requires a lot of read filters/queries and interfaces with tools like GridFS, I'm struggling to think of a sensible way to employ MongoDB in the way the above solution suggests.</p>
  
  <p>Therefore, I'm considering running an embedded instance of MongoDB alongside my integration tests. I'd like it to <strong>start up automatically</strong> (either for each test or the whole suite), <strong>flush the database</strong> for every test, and <strong>shut down</strong> at the end. These tests might be run on development machines as well as the CI server, so my solution will also need to be <strong>portable</strong>.</p>
  
  <p>Can anyone with more knowledge on MongoDB help me get idea of the feasibility of this approach, and/or perhaps suggest any reading material that might help me get started?</p>
  
  <p>I'm also open to other suggestions people might have on how I could approach this problem...</p>