I am using the MongoDB Java driver to perform some persistence in my application. The build for my application is managed via Maven and I'm looking for the best way to integrate a series of MongoDB-related unit tests into my Maven build process. I cannot assume that the user building the application has installed the MongoDB dameon as a service and therefore need to launch the daemon prior to the execution of the related unit tests.
My first thought was to store the binaries in the resources folder of the test directory (e.g., src/test/resources) and launch the daemon using Runtime.exec(). Is there an approach that's cleaner? I feel like Runtime.exec() is a quick and dirty way to get something working but not the most ideal...I need this to work on both linux and windows.