Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

MongoDB how to test locally in Java a MongoDB database, like H2 with sql database?

I’m developing a program that use MongoDB database but I’m asking if it is possible to use an internal database for test like H2 when doing SQL through Java?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You can try to use Testcontainers

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases.

Or look at https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo


Update:

It seems that there is already an answer to your question:
Embedded MongoDB when running integration tests

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading