Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedded MongoDB Attempting to download Zip

I want to use Embedded MongoDB with Spring Boot for testing.

Here's the dependency I'm importing:

testCompile('de.flapdoodle.embed:de.flapdoodle.embed.mongo')

Whenever I start the SpringBootTest the EmbeddedMongoAutoConfiguration initializes the MongodExecutable bean and that bean starts to download a zip file (version 3.2.2) from a url. How do I configure it so that it will use the zip file located within my src/test/resources directory?

like image 750
George Avatar asked Oct 29 '25 09:10

George


1 Answers

How do I configure it so that it will use the zip file located within my src/test/resources directory?

I don't know that this can be done. My solution has been to have a copy installed (for myself and my team) in the following directory:

Linux : $HOME/.embedmongo/linux/mongodb-linux-x86_64-3.2.2.tgz
Windows : C:\Users\<username>\.embedmongo\win32\mongodb-win32-x86_64-3.x.x.zip

This will avoid the need to download the embedded mongo for the Flapdoodle OSS, which Spring uses.

Caveat: If your team needs a different version of embedded mongo you can change the version for the EmbeddedMongoProperties class by adding this property to your application.properties (or .yml) file:

spring.mongodb.embedded.version = 3.4.6

like image 155
Kris Wheeler Avatar answered Oct 31 '25 06:10

Kris Wheeler