I am looking for a embedded database which I can use in JUnit 4.12
tests. Because of the current nature of our code base & time-lines it is not possible for us to mock the database calls. We are concerned only about Mysql database. So I am looking for some kind of Embedded database which I can initialize before our each test run & then clear it after the tests. Some what similar to what wiremock does for http server.
I have gone through this & it seems it is possible to achieve it via H2 embedded database. Most of the links I have found in the web talks about using it with Spring.
Can some one let me know
- If it is possible to achieve the same using H2 as embedded database for Junit tests for non-spring application? If yes can someone let me know how to do this or point me to some link where this use case is explained?
- Also is there some other tools other than H2 which I can use to achieve my goals?