1 package junitparams; 2 3 import static org.assertj.core.api.Assertions.assertThat; 4 5 import org.junit.*; 6 import org.junit.runner.*; 7 8 @RunWith(JUnitParamsRunner.class) 9 public class BeforeAfterClassTest { 10 11 private static boolean val = false; 12 13 @BeforeClass before()14 public static void before() { 15 val = true; 16 } 17 18 @AfterClass after()19 public static void after() { 20 val = false; 21 } 22 23 @Test 24 @Parameters({ " " }) test(String param)25 public void test(String param) { 26 assertThat(val).isTrue(); 27 } 28 } 29