diff --git a/junit-jupiter-migration-support/src/main/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupport.java b/junit-jupiter-migration-support/src/main/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupport.java index 5e736efdabc1..4fef3191d692 100644 --- a/junit-jupiter-migration-support/src/main/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupport.java +++ b/junit-jupiter-migration-support/src/main/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupport.java @@ -14,6 +14,7 @@ import java.util.function.Function; +import org.junit.Rule; import org.junit.jupiter.api.extension.AfterEachCallback; import org.junit.jupiter.api.extension.BeforeEachCallback; import org.junit.jupiter.api.extension.TestExtensionContext; @@ -21,6 +22,28 @@ import org.junit.jupiter.migrationsupport.rules.adapter.ExternalResourceAdapter; import org.junit.jupiter.migrationsupport.rules.member.RuleAnnotatedMember; import org.junit.platform.commons.meta.API; +import org.junit.rules.TestRule; +import org.junit.rules.Verifier; + +/** + * This {@code Extension} provides native support for subclasses of + * the {@code Verifier} rule from JUnit 4. + * {@code Rule}-annotated fields as well as methods are supported. + * + *
By using this class-level extension on a test class such + * {@code Verifier} implementations in legacy code bases + * can be left unchanged including the JUnit 4 rule import statements. + * + *
However, if you intend to develop a new extension for + * JUnit 5 please use the new extension model of JUnit Jupiter instead + * of the rule-based model of JUnit 4. + * + * + * @since 5.0 + * @see Verifier + * @see TestRule + * @see Rule + */ @API(Experimental) public class ExternalResourceSupport implements BeforeEachCallback, AfterEachCallback { diff --git a/junit-jupiter-migration-support/src/main/java/org/junit/jupiter/migrationsupport/rules/VerifierSupport.java b/junit-jupiter-migration-support/src/main/java/org/junit/jupiter/migrationsupport/rules/VerifierSupport.java index ae78014423cd..2356ef5258fc 100644 --- a/junit-jupiter-migration-support/src/main/java/org/junit/jupiter/migrationsupport/rules/VerifierSupport.java +++ b/junit-jupiter-migration-support/src/main/java/org/junit/jupiter/migrationsupport/rules/VerifierSupport.java @@ -14,13 +14,35 @@ import java.util.function.Function; +import org.junit.Rule; import org.junit.jupiter.api.extension.AfterEachCallback; import org.junit.jupiter.api.extension.TestExtensionContext; import org.junit.jupiter.migrationsupport.rules.adapter.AbstractTestRuleAdapter; import org.junit.jupiter.migrationsupport.rules.adapter.VerifierAdapter; import org.junit.jupiter.migrationsupport.rules.member.RuleAnnotatedMember; import org.junit.platform.commons.meta.API; +import org.junit.rules.ExternalResource; +import org.junit.rules.TestRule; +/** + * This {@code Extension} provides native support for subclasses of + * the {@code ExternalResource} rule from JUnit 4. + * {@code Rule}-annotated fields as well as methods are supported. + + *
By using this class-level extension on a test class such + * {@code ExternalResource} implementations in legacy code bases + * can be left unchanged including the JUnit 4 rule import statements. + * + *
However, if you intend to develop a new extension for + * JUnit 5 please use the new extension model of JUnit Jupiter instead + * of the rule-based model of JUnit 4. + * + * + * @since 5.0 + * @see ExternalResource + * @see TestRule + * @see Rule + */ @API(Experimental) public class VerifierSupport implements AfterEachCallback {