application test : junit5 - 커스텀 태그
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.example.apptest;
|
||||
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Test
|
||||
@Tag("fast")
|
||||
public @interface FastTest {
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.example.apptest;
|
||||
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Test
|
||||
@Tag("slow")
|
||||
public @interface SlowTest {
|
||||
}
|
||||
@@ -10,24 +10,40 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
|
||||
class StudyTest {
|
||||
|
||||
@Test
|
||||
@DisplayName("tag test")
|
||||
@Tag("fast")
|
||||
void test_14() {
|
||||
@FastTest
|
||||
@DisplayName("custom tag test")
|
||||
void test_16() {
|
||||
System.out.println("fast");
|
||||
Study study = new Study(10);
|
||||
assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("tag test")
|
||||
@Tag("slow")
|
||||
void test_13() {
|
||||
@SlowTest
|
||||
@DisplayName("custom tag test")
|
||||
void test_15() {
|
||||
System.out.println("slow");
|
||||
Study study = new Study(10);
|
||||
assertTrue(study.getLimit() > 0, () -> "limit 는 0보다 커야한다.");
|
||||
}
|
||||
|
||||
// @Test
|
||||
// @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("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")
|
||||
|
||||
Reference in New Issue
Block a user