title: How to create spring parametrized transactional test
body: <p>in my tests I need use spring dependency injection transactional and parameters. I found example how to use parametrized and DI:</p>
  
  <pre><code>@RunWith(value = Parameterized.class)
  @ContextConfiguration(locations = { "classpath:applicationContextTest-business.xml" })
  public class TournamentServiceTest {
  
  @Autowired
  TournamentService tournamentService;
  
      public TournamentServiceTest(int playerCount) {
          this.playerCount = playerCount;
      }
  
      @Parameters
      public static List&lt;Object[]&gt; data() {
          final List&lt;Object[]&gt; parametry = new ArrayList&lt;Object[]&gt;();
          parametry.add(new Object[] { 19 });
          parametry.add(new Object[] { 20 });
          return parametry;
      }
  
      @Before
      public void vytvorTurnaj() throws Exception {
          testContextManager = new TestContextManager(getClass());
          testContextManager.prepareTestInstance(this);
      }
  
  @Test
  public void test1() {
       Assert.assertFalse(false);
  }
  
  }
  </code></pre>
  
  <p>this example works. Now I need to add transaction to this class:</p>
  
  <pre><code>@RunWith(value = Parameterized.class)
  @ContextConfiguration(locations = { "classpath:applicationContextTest-business.xml" })
  @Transactional
  @TransactionConfiguration(defaultRollback = true)
  public class TournamentServiceTest ...
  </code></pre>
  
  <p>when I add this two new line then this test thrown exception:</p>
  
  <pre><code>org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class org.toursys.processor.service.TournamentServiceTest]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
  </code></pre>
  
  <p>because he want to add empty constructor:</p>
  
  <pre><code>public TournamentServiceTest() {
      this.playerCount = 20;
  }
  </code></pre>
  
  <p>but I cant add this because then parameterized cant run this test. How I can solve this problem ?</p>