I\'m setting up a new version of my application in a demo server and would love to find a way of resetting the database daily. I guess I can always have a cron job executing dro
If you are using spring boot see this stackoverflow question
Setup your data source. I don't have any special close on exit.
datasource: driverClassName: org.h2.Driver url: "jdbc:h2:mem:psptrx"
Spring boot @DirtiesContext annotation
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
Use @Before to initialise on each test case.
The @DirtiesContext will cause the h2 context to be dropped between each test.