注解变了
@BeforeClass------->@BeforeAll;
@AfterClass---------->@AfterAll;
@Before--------------->@BeforeEach;
@After------------------>@AfterEach;
前两个都要public static
~~
@BeforeAll
public static void test0() {
out.println("before class");
}
@BeforeEach
void test1() {
out.println("before");
}
@AfterEach
void test2() {
out.println("after");
}
@Test
void test3() {
out.println("test3");
}
@Test
void test4() {
out.println("test4");
}
@AfterAll
public static void test5() {
out.println("AfterClass");
}