1 package junitparams; 2 3 import org.junit.Test; 4 import org.junit.runner.RunWith; 5 6 import static org.assertj.core.api.Assertions.*; 7 8 @RunWith(JUnitParamsRunner.class) 9 public class ClassesAsParamsTest { 10 11 @Test 12 @Parameters({"java.lang.Object", "java.lang.String"}) passClassAsString(Class<?> clazz)13 public void passClassAsString(Class<?> clazz) { 14 assertThat(clazz).isIn(java.lang.Object.class, java.lang.String.class); 15 } 16 17 @Test(expected = IllegalArgumentException.class) 18 @Parameters("no.package.NoSuchClass") illegalArgumentExceptionWhenClassNotFound(Class<?> clazz)19 public void illegalArgumentExceptionWhenClassNotFound(Class<?> clazz) { 20 fail("Should fail on test invocation"); 21 } 22 } 23