[JUnit5] 기본 Annotation

Jiwoo Kim·2021년 3월 25일
0

단위테스트와 JUnit

목록 보기
1/9
post-thumbnail

2장 | JUnit 진짜로 써 보기

기본 Annotation

JUnit5를 기준으로 합니다.

@Test

테스트 메소드로 인식하고 테스트를 실행한다.

@Disabled

테스트 메소드로 인식하지 않고 테스트도 실행하지 않는다.

@BeforeEach vs @BeforeAll

@BeforeEach@BeforeAll
메소드instance methodstatic method
실행시점테스트 메소드 실행 전클래스 인스턴스 생성 시

@AfterEach vs @AfterAll

@AfterEach@AfterAll
메소드instance methodstatic method
실행시점테스트 메소드 실행 후인스턴스의 모든 테스트 메소드 실행 후

0개의 댓글