I would like to test transaction rollbacks in my application service. As a result i do not want to use spring's AbstractTransactionalJUnit4SpringContextTests
with the @Transactional
annotation as that wraps my test method in a transaction.
I know spring also offers AbstractJUnit4SpringContextTests
for tests without transactions. However i need to have some transactions to save data into my database and also query data for assertions after running the service under test.
How can i write a Junit 4 spring transactional test without the default transaction test management?