Skip to content

Commit 2196d97

Browse files
committed
Deprecate junit-jupiter-migrationsupport for removal in 7.0
1 parent 50ec939 commit 2196d97

30 files changed

+68
-22
lines changed

documentation/src/docs/asciidoc/release-notes/release-notes-6.0.0-M1.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ repository on GitHub.
110110
* The contracts for the `Executable` parameters of Kotlin-specific `assertTimeout`
111111
functions were changed from `callsInPlace(executable, EXACTLY_ONCE)` to
112112
`callsInPlace(executable, AT_MOST_ONCE)` which might result in compilation errors.
113+
* The `junit-jupiter-migrationsupport` artifact and its contained classes are now
114+
deprecated and will be removed in the next major version.
113115

114116
[[release-notes-6.0.0-M1-junit-jupiter-new-features-and-improvements]]
115117
==== New Features and Improvements

documentation/src/docs/asciidoc/user-guide/appendix.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ Please refer to the corresponding sections for <<running-tests-build-maven-bom,
108108
`junit-jupiter-params`::
109109
Support for <<writing-tests-parameterized-tests>> in JUnit Jupiter.
110110
`junit-jupiter-migrationsupport`::
111-
Support for migrating from JUnit 4 to JUnit Jupiter; only required for support for
112-
JUnit 4's `@Ignore` annotation and for running selected JUnit 4 rules.
111+
_Deprecated_ support for migrating from JUnit 4 to JUnit Jupiter; only required for
112+
support for JUnit 4's `@Ignore` annotation and for running selected JUnit 4 rules.
113113

114114
[[dependency-metadata-junit-vintage]]
115115
==== JUnit Vintage

documentation/src/docs/asciidoc/user-guide/migration-from-junit4.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ include::{testDir}/example/ParameterizedMigrationDemo.java[tags=after]
256256
[[migrating-from-junit4-rule-support]]
257257
=== Limited JUnit 4 Rule Support
258258

259+
WARNING: _JUnit 4 rule support_ is deprecated for removal since version 6.0.0. Please
260+
migrate to the corresponding APIs and extensions provided by JUnit Jupiter.
261+
259262
As stated above, JUnit Jupiter does not and will not support JUnit 4 rules natively. The
260263
JUnit team realizes, however, that many organizations, especially large ones, are likely
261264
to have large JUnit 4 code bases that make use of custom rules. To serve these
@@ -290,6 +293,9 @@ extension model of JUnit Jupiter instead of the rule-based model of JUnit 4.
290293
[[migrating-from-junit4-ignore-annotation-support]]
291294
=== JUnit 4 @Ignore Support
292295

296+
WARNING: _JUnit 4 `@Ignore` support_ is deprecated for removal since version 6.0.0. Please
297+
use JUnit Jupiter's `@Disabled` annotation instead.
298+
293299
In order to provide a smooth migration path from JUnit 4 to JUnit Jupiter, the
294300
`junit-jupiter-migrationsupport` module provides support for JUnit 4's `@Ignore`
295301
annotation analogous to Jupiter's `{Disabled}` annotation.

documentation/src/test/java/example/IgnoredTestsDemo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.junit.jupiter.migrationsupport.EnableJUnit4MigrationSupport;
1717

1818
// @ExtendWith(IgnoreCondition.class)
19+
@SuppressWarnings("removal")
1920
@EnableJUnit4MigrationSupport
2021
class IgnoredTestsDemo {
2122

junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/EnableJUnit4MigrationSupport.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
package org.junit.jupiter.migrationsupport;
1212

13-
import static org.apiguardian.api.API.Status.STABLE;
13+
import static org.apiguardian.api.API.Status.DEPRECATED;
1414

1515
import java.lang.annotation.ElementType;
1616
import java.lang.annotation.Retention;
@@ -47,10 +47,14 @@
4747
* @see ExpectedExceptionSupport
4848
* @see IgnoreCondition
4949
* @see EnableRuleMigrationSupport
50+
* @deprecated Please migrate to Jupiter extensions and use
51+
* {@link org.junit.jupiter.api.Disabled @Disabled} instead.
5052
*/
53+
@SuppressWarnings("removal")
5154
@Target(ElementType.TYPE)
5255
@Retention(RetentionPolicy.RUNTIME)
53-
@API(status = STABLE, since = "5.7")
56+
@API(status = DEPRECATED, since = "6.0")
57+
@Deprecated(since = "6.0", forRemoval = true)
5458
@EnableRuleMigrationSupport
5559
@ExtendWith(IgnoreCondition.class)
5660
public @interface EnableJUnit4MigrationSupport {

junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
package org.junit.jupiter.migrationsupport.conditions;
1212

13-
import static org.apiguardian.api.API.Status.STABLE;
13+
import static org.apiguardian.api.API.Status.DEPRECATED;
1414
import static org.junit.platform.commons.support.AnnotationSupport.findAnnotation;
1515

1616
import java.lang.reflect.AnnotatedElement;
@@ -32,8 +32,10 @@
3232
* @see org.junit.jupiter.api.Disabled @Disabled
3333
* @see #evaluateExecutionCondition(ExtensionContext)
3434
* @see org.junit.jupiter.migrationsupport.EnableJUnit4MigrationSupport
35+
* @deprecated Please use {@link org.junit.jupiter.api.Disabled @Disabled} instead.
3536
*/
36-
@API(status = STABLE, since = "5.7")
37+
@API(status = DEPRECATED, since = "6.0")
38+
@Deprecated(since = "6.0", forRemoval = true)
3739
public class IgnoreCondition implements ExecutionCondition {
3840

3941
private static final ConditionEvaluationResult ENABLED = //

junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/package-info.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Extensions which provide support for conditional test execution features of
3-
* JUnit 4 (e.g., the {@link org.junit.Ignore @Ignore} annotation) within JUnit
4-
* Jupiter.
2+
* <em>Deprecated</em> extensions that provide support for conditional test
3+
* execution features of JUnit 4 (e.g., the {@link org.junit.Ignore @Ignore}
4+
* annotation) within JUnit Jupiter.
55
*/
66

77
@NullMarked

junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Support for migrating from JUnit 4 to JUnit Jupiter.
2+
* <em>Deprecated</em> support for migrating from JUnit 4 to JUnit Jupiter.
33
*/
44

55
@NullMarked

junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupport.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
package org.junit.jupiter.migrationsupport.rules;
1212

13-
import static org.apiguardian.api.API.Status.STABLE;
13+
import static org.apiguardian.api.API.Status.DEPRECATED;
1414

1515
import java.lang.annotation.ElementType;
1616
import java.lang.annotation.Retention;
@@ -36,10 +36,13 @@
3636
* @see VerifierSupport
3737
* @see ExpectedExceptionSupport
3838
* @see org.junit.jupiter.migrationsupport.EnableJUnit4MigrationSupport
39+
* @deprecated Please migrate to Jupiter extensions.
3940
*/
41+
@SuppressWarnings("removal")
4042
@Target(ElementType.TYPE)
4143
@Retention(RetentionPolicy.RUNTIME)
42-
@API(status = STABLE, since = "5.7")
44+
@API(status = DEPRECATED, since = "6.0")
45+
@Deprecated(since = "6.0", forRemoval = true)
4346
@ExtendWith(ExternalResourceSupport.class)
4447
@ExtendWith(VerifierSupport.class)
4548
@ExtendWith(ExpectedExceptionSupport.class)

junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupport.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212

1313
import static java.lang.Boolean.FALSE;
1414
import static java.lang.Boolean.TRUE;
15-
import static org.apiguardian.api.API.Status.STABLE;
15+
import static org.apiguardian.api.API.Status.DEPRECATED;
1616

1717
import org.apiguardian.api.API;
1818
import org.junit.jupiter.api.extension.AfterEachCallback;
1919
import org.junit.jupiter.api.extension.ExtensionContext;
2020
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
2121
import org.junit.jupiter.api.extension.ExtensionContext.Store;
2222
import org.junit.jupiter.api.extension.TestExecutionExceptionHandler;
23+
import org.junit.jupiter.api.function.Executable;
2324
import org.junit.jupiter.migrationsupport.rules.adapter.ExpectedExceptionAdapter;
2425
import org.junit.rules.ExpectedException;
2526

@@ -38,8 +39,13 @@
3839
* @see org.junit.rules.ExpectedException
3940
* @see org.junit.rules.TestRule
4041
* @see org.junit.Rule
42+
* @deprecated Please use
43+
* {@link org.junit.jupiter.api.Assertions#assertThrows(Class, Executable)}
44+
* instead.
4145
*/
42-
@API(status = STABLE, since = "5.7")
46+
@SuppressWarnings("removal")
47+
@API(status = DEPRECATED, since = "6.0")
48+
@Deprecated(since = "6.0", forRemoval = true)
4349
public class ExpectedExceptionSupport implements AfterEachCallback, TestExecutionExceptionHandler {
4450

4551
private static final String EXCEPTION_WAS_HANDLED = "exceptionWasHandled";

0 commit comments

Comments
 (0)