Rollback transaction after @Test
Just add @Transactional annotation on top of your test: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {“testContext.xml”}) @Transactional public class StudentSystemTest { By default Spring will start a new transaction surrounding your test method and @Before/@After callbacks, rolling back at the end. It works by default, it’s enough to have some transaction manager in the context. From: 10.3.5.4 Transaction … Read more