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