I have a suite of tests that make db calls (via spring-data-jpa) and assert the result against an in memory database (mariadb4j).
Before every test, it restarts the spring context providing me with a new spring context and database every time and I can parallelise this process without any harm as each test has it's own context and can run separately.
However, what I would really like is not to have to start a spring application for each test since all the test is doing is using interfaces extending CrudRepository to insert to the db and make assertions.
I tried only recreating the datasource bean and couldn't get it working (but even if I could, I don't think it's a valid solution when parallelising tests)
I look forward to hearing your suggestions