-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Overview
As can be seen in #4876 (comment), org.junit.jupiter.api.extension.MediaType 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, we should relocate MediaType to the org.junit.jupiter.api package and deprecate the existing class.
Specifically, I am proposing the following.
- Introduce
org.junit.jupiter.api.MediaTypeas a copy oforg.junit.jupiter.api.extension.MediaType. - Declare
org.junit.jupiter.api.MediaTypeas a sealed type permitting onlyorg.junit.jupiter.api.extension.MediaTypeas a subtype. - Have
org.junit.jupiter.api.extension.MediaTypeextendorg.junit.jupiter.api.MediaType. - Deprecate
org.junit.jupiter.api.extension.MediaTypefor removal. - Update all APIs that reference
org.junit.jupiter.api.extension.MediaTypeto referenceorg.junit.jupiter.api.MediaTypeinstead.
Since org.junit.jupiter.api.MediaType is a relatively new API, we assume that it is not actively used by many projects yet. In light of that, we are considering deprecating the current APIs for JUnit 6.0.
However, we hope that affected users will only need to change their imports from org.junit.jupiter.api.extension.MediaType to org.junit.jupiter.api.MediaType to address any issues.