I have a lot of DAO tests which access the database. I tried to mock them using Java in memory database like H2. But the problem is the ddl scripts contain partition statements which does not seem to be supported by H2. I basically want to use the same ddl scripts as in production and do not want to modify them in any manner for my "unit" tests. I also tried HSQL, but found H2 more closely resembles oracle, but even then it doesnt support partition. Is there a workaround for this ?
I did look at the following Create an in-memory database structure from an Oracle instance It talks about using H2 but I have already mentioned its shortcomings. Looking for some alternatives.
If you want meaningful tests, you'll need to run them against an instance of the same database version as you will run in production.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With