-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Relocate MediaType
to jupiter.api
package and deprecate existing class
#4916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sbrannen
merged 1 commit into
junit-team:main
from
sbrannen:issues/4886-jupiter.api.MediaType
Sep 13, 2025
Merged
Relocate MediaType
to jupiter.api
package and deprecate existing class
#4916
sbrannen
merged 1 commit into
junit-team:main
from
sbrannen:issues/4886-jupiter.api.MediaType
Sep 13, 2025
+490
−80
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marcphilipp
reviewed
Sep 8, 2025
marcphilipp
reviewed
Sep 9, 2025
junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContext.java
Outdated
Show resolved
Hide resolved
ef2e5db
to
e9d4fe4
Compare
98300a4
to
26a3691
Compare
marcphilipp
approved these changes
Sep 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for the missing release notes entry.
org.junit.jupiter.api.extension.MediaType currently causes cycles between the `api` and `api.extension` packages in junit-jupiter-api. Since the junit-jupiter-api artifact constitutes the public API for JUnit Jupiter, we have traditionally not allowed package cycles within that artifact. Thus, in order to reduce package cycles and improve the quality of the code base, this commit introduces a new MediaType in the org.junit.jupiter.api package. Note that the existing MediaType now extends the new MediaType. To encourage users to migrate to the new supported MediaType this commit also introduces the following deprecations. * `org.junit.jupiter.api.extension.MediaType` is now deprecated in favor of the new `org.junit.jupiter.api.MediaType`. * The `publishFile(...)` methods in `TestReporter` which accept an `org.junit.jupiter.api.extension.MediaType` are now deprecated in favor of new variants which accept an `org.junit.jupiter.api.MediaType`. * The `publishFile(...)` method in `ExtensionContext` which accepts an `org.junit.jupiter.api.extension.MediaType` is now deprecated in favor of a new variant which accepts an `org.junit.jupiter.api.MediaType`. Furthermore, we plan to remove the deprecated MediaType in JUnit 6.2. See junit-team#4876 Closes junit-team#4886
26a3691
to
9990349
Compare
I just added that and also made a final pass over the change set, polishing a bit along the way. So, feel free to take another look... |
marcphilipp
approved these changes
Sep 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
org.junit.jupiter.api.extension.MediaType
currently causes cycles between theapi
andapi.extension
packages injunit-jupiter-api
.Since the
junit-jupiter-api
artifact constitutes the public API for JUnit Jupiter, we have traditionally not allowed package cycles within that artifact.Thus, in order to reduce package cycles and improve the quality of the code base, this PR introduces a new
MediaType
in theorg.junit.jupiter.api
package. Note that the existingMediaType
now extends the newMediaType
.To encourage users to migrate to the new supported
MediaType
this commit also introduces the following deprecations.org.junit.jupiter.api.extension.MediaType
is now deprecated in favor of the neworg.junit.jupiter.api.MediaType
.publishFile(...)
methods inTestReporter
which accept anorg.junit.jupiter.api.extension.MediaType
are now deprecated in favor of new variants which accept anorg.junit.jupiter.api.MediaType
.publishFile(...)
method inExtensionContext
which accepts anorg.junit.jupiter.api.extension.MediaType
is now deprecated in favor of a new variant which accepts anorg.junit.jupiter.api.MediaType
.Furthermore, we plan to remove the deprecated
MediaType
in JUnit 6.2.Related Issues
MediaType
tojupiter.api
package and deprecate existing class #4886