1 package junitparams; 2 3 import static org.hamcrest.CoreMatchers.*; 4 import static org.junit.Assert.*; 5 6 import org.junit.*; 7 8 import junitparams.usage.person_example.PersonTest.*; 9 10 public class SubclassTest extends SuperclassTest { 11 12 @Test 13 @Parameters(method = "paramsForIsAdult") isAdult(int age, boolean valid)14 public void isAdult(int age, boolean valid) throws Exception { 15 assertThat(new Person(age).isAdult(), is(valid)); 16 } 17 18 @SuppressWarnings("unused") paramsForSuperclassMethod()19 private Object[] paramsForSuperclassMethod() { 20 return new Object[]{1}; 21 } 22 }