1 package junitparams; 2 3 import org.junit.Test; 4 import org.junit.runner.RunWith; 5 6 @RunWith(JUnitParamsRunner.class) 7 public class SampleTestCase { 8 9 @Test firstTestMethod()10 public void firstTestMethod() throws Exception { 11 12 } 13 14 @Test 15 @Parameters(method = "getParameters") secondTestMethod(String parameter)16 public void secondTestMethod(String parameter) throws Exception { 17 18 } 19 getParameters()20 private Object[] getParameters() { 21 return new Object[]{"a", "b"}; 22 } 23 24 } 25