@Rollback(false) not working on @Before using SpringJUnit4ClassRunner
问题 In a JUnit test in my Spring application, I'd like to insert a lot of data in a setup method, and then use it to test against. However, whatever is done in the @Before method appears to be rolled back after each test, even if I annotate the method with @Rollback(false) Here's a simplified version of what I'm trying to do: public class TestClass { @Autowired MyService service; @Before public void setup() { if(service.getById(1) == null) { Thing thing = new Thing(); thing.setId(1); service