I was looking for a solution to this problem. And there is one! But, as it comes from a blog, I canβt take responsibility for it. :-)
Unfortunately, I can no longer find the original blog ...
@RunWith(Parameterized.class) @ContextConfiguration("/beans.xml") public class MyTest { private final File file; public MyTest(final File file) { this.file = file; } @Autowired private PlatformTransactionManager transactionManager; private TestContextManager testContextManager; @Parameterized.Parameters public static Collection<File[]> getFilesToTest() throws Exception { return getValidFiles(); } @Before public void setUpSpringContext() throws Exception { testContextManager = new TestContextManager(getClass()); testContextManager.prepareTestInstance(this);
source share