3

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?

Paul
  • 19,704
  • 14
  • 78
  • 96
ThrowsError
  • 1,169
  • 1
  • 11
  • 43

1 Answers1

2

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

Danil Perestoronin
  • 1,063
  • 1
  • 7
  • 9