Hi,
I have some legacy code that creates its own database connection. To test this code I extended from AbstractTransactionalSpringContextTests like this:
Now I'd like to do the same in JUnit 4 style, i.e. by extending AbstractTransactionalJUnit4SpringContextTests. This class doesn't have the methods setComplete(), endTransaction() and startNewTransaction(). How can I write my test?Code:public class LegacyCodeTest extends AbstractTransactionalSpringContextTests { public void testLegacyCode() { // set up test data in database setComplete(); endTransaction(); startNewTransaction(); // call legacy code - this code creates its own database connection // verify results in database } }


Reply With Quote
