인프런의 "더 자바, 애플리케이션을 테스트하는 다양한 방법”을 보고 정리한 것임
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>
@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
class TestStudyTest {
@DisplayName("스터디 만들기")
@Test
void create_new_study() {
TestStudy testStudy = new TestStudy();
assertNotNull(testStudy);
System.out.println("create!");
}
@Test
void create_new_study_again() {
TestStudy testStudy = new TestStudy();
assertNotNull(testStudy);
System.out.println("create2!");
}
@BeforeAll
static void beforeAll() {
System.out.println("BeforeAll!");
}
@AfterAll
static void afterAll() {
System.out.println("AfterAll!");
}
@BeforeEach
void setUp() {
System.out.println("BeforeEach!");
}
@AfterEach
void tearDown() {
System.out.println("AfterEach!");
}
}