I have a jUnit4 test case class ( extends TestCase). I am testing some code having Spring D.I and Hibernate. Somehow when i execute test ,looks like some internal transactions are rolling my test changes back. I am deleting a record using HibernateTemplate but nothing is getting deleted in database. I got a suggestion to make my test case transactional by making my class a Spring test class( using Spring Test Runner ) and use @Transactional attribute before method call. Can somebody please tell how can i make my Junit4 test class Spring test class? What configs do I need and which class to extend?
Thanks in advance.
Extend
AbstractTransactionalJUnit4SpringContextTestsor add these annotations to your test class: