기본 애노테이션
@Test
- 개별적인 실행이 가능한 테스트 함수를 지정합니다
@Test
void create1() {
System.out.println("create test");
}
@Disabled
@Test
@Disabled
void create2() {
System.out.println("create test 2");
}
@BeforeEach
- 한 테스트가 시작하기 전 실행
- 같은 클래스 내에 존재하는 모든 테스트에게 적용
@BeforeEach
void beforeEach() {
System.out.println("before each");
}
@AfterEach
@AfterEach
void afterEach() {
System.out.println("after each");
}
@BeforeAll
- 모든 테스트가 실행되기 이전에 단 한번만 실행됨
- 반드시 static void 로 선언, 메서드명 제약 없음
@BeforeAll
static void beforeAll() {
System.out.println("before all");
}
@AfterAll