I'm doing some test data load inside the setup() method. That is, I want this test data to be setup once and be available for all tests within the class.
However, a transaction test method (annotated with @Test and @Rollback(true), causes the setup method to rollback as well..
Is there a way to make sure that only the test method rolls back and not the setup? Note :- Can't use @BeforeClass, as I need access to Autowired beans from spring context, which are not available in static context of setup(), if it's annotated as @BeforeClass.
Thanks, Shekhar
PS : A similar question was asked in stackoverflow but never answered :- @Rollback(false) not working on @Before using SpringJUnit4ClassRunner