I'm using the Spring transactional test classes to do unit testing of my DAO code. What I want to do is create my database once, before all the tests run. I have a @BeforeClass annotated method but that runs before Spring loads up the application context and configures the jdbcTemplate, thus I don't actually have a connection to the DB at that time. Is there a way to run my DB setup once after the context loads but before the tests start running?
This thead asks the same question but the accepted solution seems to just be "don't do that". I'm inclined to say this just seems like it isn't doable.