application test : junit5 - 태깅, 필터링

This commit is contained in:
haerong22
2021-02-24 18:46:14 +09:00
parent ea6c1e3ae1
commit 7c44dd71c4
2 changed files with 57 additions and 8 deletions

View File

@@ -38,4 +38,35 @@
</plugins>
</build>
<profiles>
<profile>
<!-- 기본 profile 설정 -->
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<!-- 빌드시 사용할 설정 추가-->
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<groups>fast</groups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>ci</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@@ -11,23 +11,41 @@ import static org.junit.jupiter.api.Assertions.*;
class StudyTest {
@Test
@DisplayName("DisabledIfEnvironmentVariable test")
@DisabledIfEnvironmentVariable(named = "TEST_ENV", matches = "KIM")
void test_12() {
System.out.println("테스트");
@DisplayName("tag test")
@Tag("fast")
void test_14() {
System.out.println("fast");
Study study = new Study(10);
assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
}
@Test
@DisplayName("EnabledIfEnvironmentVariable test")
@EnabledIfEnvironmentVariable(named = "TEST_ENV", matches = "KIM")
void test_11() {
System.out.println("테스트");
@DisplayName("tag test")
@Tag("slow")
void test_13() {
System.out.println("slow");
Study study = new Study(10);
assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
}
// @Test
// @DisplayName("DisabledIfEnvironmentVariable test")
// @DisabledIfEnvironmentVariable(named = "TEST_ENV", matches = "KIM")
// void test_12() {
// System.out.println("테스트");
// Study study = new Study(10);
// assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
// }
//
// @Test
// @DisplayName("EnabledIfEnvironmentVariable test")
// @EnabledIfEnvironmentVariable(named = "TEST_ENV", matches = "KIM")
// void test_11() {
// System.out.println("테스트");
// Study study = new Study(10);
// assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
// }
// @Test
// @DisplayName("EnabledOnJre test")
// @EnabledOnJre({JRE.JAVA_8, JRE.JAVA_11})