title: How to implement JUnit 4 parameterized tests in JUnit 5?
body: <p>In JUnit 4 it was easy to test invariants across a bunch of classes by using the <a href="http://junit.org/junit4/javadoc/4.12/org/junit/runners/Parameterized.html" rel="noreferrer"><code>@Parameterized</code></a> annotation. The key thing is that a collection of tests are being run against a single list of arguments.</p>
  
  <p>How to replicate this in JUnit 5, without using JUnit-vintage?</p>
  
  <p><a href="http://junit.org/junit5/docs/current/user-guide/#writing-tests-parameterized-tests" rel="noreferrer"><code>@ParameterizedTest</code></a> is not applicable to a test class. <a href="http://junit.org/junit5/docs/current/user-guide/#writing-tests-test-templates" rel="noreferrer"><code>@TestTemplate</code></a> sounded like it might be appropriate, but that annotation's target is also a method.</p>
  
  <hr>
  
  <p>An example of such a JUnit 4 test is:</p>
  
  <pre><code>@RunWith( Parameterized.class )
  public class FooInvariantsTest{
  
     @Parameterized.Parameters
     public static Collection&lt;Object[]&gt; data(){
         return new Arrays.asList(
                 new Object[]{ new CsvFoo() ),
                 new Object[]{ new SqlFoo() ),
                 new Object[]{ new XmlFoo() ),
             );
     }
  
     private Foo fooUnderTest;
  
  
     public FooInvariantsTest( Foo fooToTest ){
          fooUnderTest = fooToTest;
     }
  
     @Test
     public void testInvariant1(){
         ...
     }
  
     @Test
     public void testInvariant2(){
         ...
     } 
  }
  </code></pre>