Top For Removal Deprecated By Reference
JUnit 6.0.1

Deprecated API


Terminally Deprecated Item Summary

SinceTerminally Deprecated Item and Description
5.14
org.junit.jupiter.api.TestReporter.publishFile(Path
the file to be published; never null
file
,
MediaType
the media type of the file; never null; use org.junit.jupiter.api.extension.MediaType#APPLICATION_OCTET_STREAM if unknown
mediaType
)

Use publishFile(Path, MediaType) instead.

5.14
org.junit.jupiter.api.TestReporter.publishFile(String
the name of the file to be published; never null or blank and must not contain any path separators
name
,
MediaType
the media type of the file; never null; use org.junit.jupiter.api.extension.MediaType#APPLICATION_OCTET_STREAM if unknown
mediaType
,
ThrowingConsumer<Path>
the action to be executed to write the file; never null
action
)

Use publishFile(String, MediaType, ThrowingConsumer) instead.

6.0
org.junit.jupiter.api.condition.JRE.JAVA_10

No longer supported at runtime; please use JAVA_17 or later

6.0
org.junit.jupiter.api.condition.JRE.JAVA_11

No longer supported at runtime; please use JAVA_17 or later

6.0
org.junit.jupiter.api.condition.JRE.JAVA_12

No longer supported at runtime; please use JAVA_17 or later

6.0
org.junit.jupiter.api.condition.JRE.JAVA_13

No longer supported at runtime; please use JAVA_17 or later

6.0
org.junit.jupiter.api.condition.JRE.JAVA_14

No longer supported at runtime; please use JAVA_17 or later

6.0
org.junit.jupiter.api.condition.JRE.JAVA_15

No longer supported at runtime; please use JAVA_17 or later

6.0
org.junit.jupiter.api.condition.JRE.JAVA_16

No longer supported at runtime; please use JAVA_17 or later

6.0
org.junit.jupiter.api.condition.JRE.JAVA_8

No longer supported at runtime; please use JAVA_17 or later

6.0
org.junit.jupiter.api.condition.JRE.JAVA_9

No longer supported at runtime; please use JAVA_17 or later

5.14
org.junit.jupiter.api.extension.ExtensionContext.publishFile(String
the name of the file to be published; never null or blank and must not contain any path separators
name
,
MediaType
the media type of the file; never null; use org.junit.jupiter.api.extension.MediaType#APPLICATION_OCTET_STREAM if unknown
mediaType
,
ThrowingConsumer<Path>
the action to be executed to write the file; never null
action
)

Use publishFile(String, MediaType, ThrowingConsumer) instead.

5.14
org.junit.jupiter.migrationsupport

Released in junit-jupiter-migrationsupport 6.0.1.

Please migrate to the corresponding APIs and extensions provided by JUnit Jupiter.
6.0
org.junit.jupiter.migrationsupport.EnableJUnit4MigrationSupport

Please migrate to Jupiter extensions and use @Disabled instead.

6.0
6.0
6.0
6.0
6.0
5.14
5.14
5.14
5.14

Returns:

the closest ParameterInfo instance for the supplied ExtensionContext; potentially null
org.junit.jupiter.params.support.ParameterInfo.get
(ExtensionContext context)

Please use org.junit.jupiter.params.ParameterInfo#get(ExtensionContext) instead

1.14

Returns:

an immutable list of all such resources found; never null but potentially empty
org.junit.platform.commons.support.ReflectionSupport.findAllResourcesInClasspathRoot
(URI
the URI for the classpath root in which to scan; never null
root
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)

Please use ResourceSupport#findAllResourcesInClasspathRoot(URI, ResourceFilter) instead

1.14

Returns:

an immutable list of all such resources found; never null but potentially empty
org.junit.platform.commons.support.ReflectionSupport.findAllResourcesInModule
(String
the name of the module to scan; never null or empty
moduleName
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)

Please use ResourceSupport#findAllResourcesInModule(String, ResourceFilter) instead

1.14

Returns:

an immutable list of all such classes found; never null but potentially empty
org.junit.platform.commons.support.ReflectionSupport.findAllResourcesInPackage
(String
the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax
basePackageName
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)

Please use ResourceSupport#findAllResourcesInPackage(String, ResourceFilter) instead

1.14

Returns:

a stream of all such classes found; never null but potentially empty
org.junit.platform.commons.support.ReflectionSupport.streamAllResourcesInClasspathRoot
(URI
the URI for the classpath root in which to scan; never null
root
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)

Please use ResourceSupport#streamAllResourcesInClasspathRoot(URI, ResourceFilter) instead

1.14

Returns:

a stream of all such resources found; never null but potentially empty
org.junit.platform.commons.support.ReflectionSupport.streamAllResourcesInModule
(String
the name of the module to scan; never null or empty
moduleName
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)

Please use ResourceSupport#streamAllResourcesInModule(String, ResourceFilter) instead

1.14

Returns:

a stream of all such resources found; never null but potentially empty
org.junit.platform.commons.support.ReflectionSupport.streamAllResourcesInPackage
(String
the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax
basePackageName
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)

Please use ResourceSupport#streamAllResourcesInPackage(String, ResourceFilter) instead

1.14

Returns:

a successful Try containing the set of loaded resources (potentially empty) or a failed Try containing the exception in case a failure occurred while trying to list resources; never null
org.junit.platform.commons.support.ReflectionSupport.tryToGetResources
(String
the name of the resource to load; never null or blank
classpathResourceName
)

Please use ResourceSupport#tryToGetResources(String) instead

1.14

Returns:

a successful Try containing the set of loaded resources (potentially empty) or a failed Try containing the exception in case a failure occurred while trying to list resources; never null
org.junit.platform.commons.support.ReflectionSupport.tryToGetResources
(String
the name of the resource to load; never null or blank
classpathResourceName
,
ClassLoader
the ClassLoader to use; never null
classLoader
)

Please use ResourceSupport#tryToGetResources(String, ClassLoader) instead

1.14
1.14

Returns:

a list of all such resources found; never null but potentially empty
org.junit.platform.commons.support.scanning.ClasspathScanner.scanForResourcesInClasspathRoot
(URI
the URI for the classpath root in which to scan; never null
root
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)

Please implement scanForResourcesInClasspathRoot(URI, ResourceFilter) instead

1.14

Returns:

a list of all such resources found; never null but potentially empty
org.junit.platform.commons.support.scanning.ClasspathScanner.scanForResourcesInPackage
(String
the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax
basePackageName
,
Predicate<Resource>
the resource type filter; never null
resourceFilter
)

Please implement scanForResourcesInPackage(String, ResourceFilter) instead

1.14

Returns:

the output directory provider; never null
org.junit.platform.engine.EngineDiscoveryRequest.getOutputDirectoryProvider
()

Please use getOutputDirectoryCreator() instead

1.14
6.0
org.junit.platform.engine.Filter.adaptFilter(Filter<V>
the filter to be adapted
adaptee
,
Function<T, V>
the converter function to apply
converter
)

without replacement

1.14
1.14
org.junit.platform.engine.discovery.DiscoverySelectors.selectClasspathResource(Set<Resource>
a set of classpath resources; never null or empty. All resources must have the same name, may not be null or blank.
classpathResources
)

Please use selectClasspathResourceByName(Set) instead.

1.14
1.14

Returns:

this builder for method chaining
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.Builder.addResourceContainerSelectorResolver
(Predicate<Resource>
predicate the resolved classes must satisfy; never null
resourceFilter
)

Please use addResourceContainerSelectorResolver(ResourceFilter) instead.

1.14

Returns:

the output directory provider; never null
org.junit.platform.launcher.TestPlan.getOutputDirectoryProvider
()

Please use getOutputDirectoryCreator() instead

1.14

Returns:

this builder for method chaining
org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.outputDirectoryProvider
(OutputDirectoryProvider
the output directory provider to use; never null
outputDirectoryProvider
)

Please use outputDirectoryCreator(OutputDirectoryCreator) instead

1.14

Returns:

this builder for method chaining
org.junit.platform.testkit.engine.EngineTestKit.Builder.outputDirectoryProvider
(OutputDirectoryProvider
the output directory provider to use; never null
outputDirectoryProvider
)

Please use outputDirectoryCreator(OutputDirectoryCreator) instead

Deprecated Item Summary

SinceDeprecated Item and Description
5.12

Returns:

the display name for the test; never blank
org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForMethod
(Class<?>
the class the test method is invoked on; never null
testClass
,
Method
method to generate a display name for; never null
testMethod
)

in favor of generateDisplayNameForMethod(List, Class, Method)

5.12

Returns:

the display name for the nested class; never blank
org.junit.jupiter.api.DisplayNameGenerator.generateDisplayNameForNestedClass
(Class<?>
the class to generate a name for; never null
nestedClass
)

in favor of generateDisplayNameForNestedClass(List, Class)

5.12

Returns:

the JRE for the currently executing JVM, potentially OTHER
org.junit.jupiter.api.condition.JRE.currentVersion
()

in favor of currentJre()

5.13
6.0

Returns:

the object; never null
org.junit.jupiter.api.extension.ExtensionContext.Store.getOrComputeIfAbsent
(Class<V>
the type of object to retrieve; never null
type
)

Please use computeIfAbsent(Class) instead.

6.0

Returns:

the value; potentially null
org.junit.jupiter.api.extension.ExtensionContext.Store.getOrComputeIfAbsent
(K
the key; never null
key
,
Function<? super K, ? extends V>
the function called with the supplied key to create a new value; never null but may return null
defaultCreator
)

Please use computeIfAbsent(Object, Function) instead.

6.0

Returns:

the value; potentially null
org.junit.jupiter.api.extension.ExtensionContext.Store.getOrComputeIfAbsent
(K
the key; never null
key
,
Function<? super K, ? extends V>
the function called with the supplied key to create a new value; never null but may return null
defaultCreator
,
Class<V>
the required type of the value; never null
requiredType
)

Please use computeIfAbsent(Object, Function, Class) instead.

5.14
5.12
org.junit.jupiter.api.extension.TestInstantiationAwareExtension.ExtensionContextScope.DEFAULT

This behavior will be removed from future versions of JUnit, and TEST_METHOD will become the default.

5.13
5.13
5.13
5.13
5.13
5.13
5.13
5.13

Returns:

a stream of arguments; never null
org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider.provideArguments
(ExtensionContext
the current extension context; never null
context
,
A
the annotation to process; never null
annotation
)

Please implement provideArguments(ParameterDeclarations, ExtensionContext, Annotation) instead.

5.13

Returns:

a stream of arguments; never null
org.junit.jupiter.params.provider.ArgumentsProvider.provideArguments
(ExtensionContext
the current extension context; never null
context
)

Please implement provideArguments(ParameterDeclarations, ExtensionContext) instead.

1.12

Returns:

an Optional containing the annotation; never null but potentially empty
org.junit.platform.commons.support.AnnotationSupport.findAnnotation
(@Nullable Class<?>
the class on which to search for the annotation; may be null
clazz
,
Class<A>
the annotation type to search for; never null
annotationType
,
SearchOption
the SearchOption to use; never null
searchOption
)

Use findAnnotation(AnnotatedElement, Class) (for SearchOption.DEFAULT) or findAnnotation(Class, Class, List) (for SearchOption.INCLUDE_ENCLOSING_CLASSES) instead

1.12
org.junit.platform.commons.support.SearchOption

because there is only a single non-deprecated search option left

1.12
org.junit.platform.commons.support.SearchOption.INCLUDE_ENCLOSING_CLASSES

because it is preferable to inspect the runtime enclosing types of a class rather than where they are declared.

1.11
org.junit.platform.engine.ExecutionRequest(TestDescriptor rootTestDescriptor, EngineExecutionListener engineExecutionListener, ConfigurationParameters configurationParameters)

without replacement because it's an internal API.

1.11

Returns:

a new ExecutionRequest; never null
org.junit.platform.engine.ExecutionRequest.create
(TestDescriptor
the engine's root TestDescriptor
rootTestDescriptor
,
EngineExecutionListener
the EngineExecutionListener to be notified of test execution events
engineExecutionListener
,
ConfigurationParameters
ConfigurationParameters that the engine may use to influence test execution
configurationParameters
)

without replacement

6.0

Returns:

the stored value; may be null
org.junit.platform.engine.support.store.NamespacedHierarchicalStore.getOrComputeIfAbsent
(N
the namespace; never null
namespace
,
K
the key; never null
key
,
Function<? super K, ? extends V>
the function called with the supplied key to create a new value; never null but may return null
defaultCreator
)

Please use computeIfAbsent(Object, Object, Function) instead.

6.0

Returns:

the stored value; may be null
org.junit.platform.engine.support.store.NamespacedHierarchicalStore.getOrComputeIfAbsent
(N
the namespace; never null
namespace
,
K
the key; never null
key
,
Function<? super K, ? extends V>
the function called with the supplied key to create a new value; never null but may return null
defaultCreator
,
Class<V>
the required type of the value; never null
requiredType
)

Please use computeIfAbsent(Object, Object, Function, Class) instead.

1.10

Returns:

the identifier with the supplied unique ID; never null
org.junit.platform.launcher.TestPlan.getTestIdentifier
(String
the unique ID to look up the identifier for; never null or blank
uniqueId
)

Use getTestIdentifier(UniqueId) instead.

6.0
org.junit.vintage.engine.Constants

Should only be used temporarily while migrating tests to JUnit Jupiter or another testing framework with native JUnit Platform support

6.0
org.junit.vintage.engine.VintageTestEngine

Should only be used temporarily while migrating tests to JUnit Jupiter or another testing framework with native JUnit Platform support

Deprecated Reference Summary

SinceItem with Deprecated Reference and Description
org.junit.jupiter.api.extension.MediaType.APPLICATION_JSON

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.api.extension.MediaType.APPLICATION_OCTET_STREAM

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.api.extension.MediaType.IMAGE_JPEG

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.api.extension.MediaType.IMAGE_PNG

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.api.extension.MediaType.TEXT_PLAIN

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.api.extension.MediaType.TEXT_PLAIN_UTF_8

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

Returns:

the media type
org.junit.jupiter.api.extension.MediaType.create
(String
the type; never null or blank
type
,
String
the subtype; never null or blank
subtype
)

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

Returns:

the media type
org.junit.jupiter.api.extension.MediaType.create
(String
the type; never null or blank
type
,
String
the subtype; never null or blank
subtype
,
Charset
the charset; never null
charset
)

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

Returns:

the parsed media type
org.junit.jupiter.api.extension.MediaType.parse
(String
the media type value to parse; never null or blank
value
)

MediaType is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.engine.extension.TempDirectory.createTempDir(TempDirFactory factory, CleanupMode cleanupMode, Class<?> elementType, AnnotatedElementContext elementContext, ExtensionContext extensionContext)

TempDirectory.CloseablePath is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.engine.extension.TempDirectory.CloseablePath

ExtensionContext.Store.CloseableResource is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.engine.extension.TempDirectory.FailureTracker

ExtensionContext.Store.CloseableResource is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.engine.extension.TimeoutInvocationFactory.ExecutorResource

ExtensionContext.Store.CloseableResource is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.params.DefaultParameterInfo

ParameterInfo is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.jupiter.params.ParameterizedInvocationContext.CloseableArgument

ExtensionContext.Store.CloseableResource is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.platform.commons.support.DefaultResource

Resource is deprecated or references (maybe indirectly) at least one deprecated element.

Returns:

a new Resource
org.junit.platform.commons.support.Resource.of
(Resource
the resource to copy attributes from; never null
resource
)

Resource is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.platform.commons.support.SearchOption.DEFAULT

SearchOption is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.platform.commons.support.SearchOption.valueOf(String name)

SearchOption is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.platform.commons.support.SearchOption.values()

SearchOption is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.platform.engine.reporting.OutputDirectoryProvider.castOrAdapt(OutputDirectoryCreator outputDirectoryCreator)

OutputDirectoryProvider is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.platform.engine.reporting.OutputDirectoryProviderAdapter

OutputDirectoryProvider is deprecated or references (maybe indirectly) at least one deprecated element.

org.junit.platform.launcher.core.DelegatingLauncherDiscoveryRequest.getOutputDirectoryProvider()

OutputDirectoryProvider is deprecated or references (maybe indirectly) at least one deprecated element.