Skip to content
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

Upgrade to JUnit 5.12.1 #46871

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Upgrade to JUnit 5.12.1 #46871

wants to merge 5 commits into from

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Mar 18, 2025

JUnit 5.11 changed the inheritance rules to be more in line with what Java does - which was actually a problem for us as we were relying on static fields registering extensions to be overridable in subclasses.

See https://junit.org/junit5/docs/5.11.1/release-notes/#release-notes-5.11.0-junit-platform-bug-fixes for more context.

While the change somehow makes sense from a theoretical POV, it's a bit in the way in several cases.

I fixed a few tests in the main repository and I'm in the process of fixing some of the tests in the RESTEasy Reactive test suite.

This PR also makes sure we use the same JUnit versioned artifact everywhere so that Dependabot creates only one PR for all the Maven projects.

Creating as draft as still making progress on the RESTEasy Reactive test suite part and also I don't want to step on @holly-cummins' toes.

@quarkus-bot quarkus-bot bot added area/arc Issue related to ARC (dependency injection) area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle area/platform Issues related to definition and interaction with Quarkus Platform area/rest area/resteasy-classic labels Mar 18, 2025
gsmet added a commit to gsmet/resteasy-reactive-testsuite that referenced this pull request Mar 19, 2025
We cannot override a static field anymore and... that being said,
considering the failures I see, I think it wasn't working very well
before.

The following core PR is required for experimenting with this work:
quarkusio/quarkus#46871

A good example of this problem is JAXRSProvidersClient0098:

- The test should fail with a NoClassDefFoundError as
  `getPropertiesTest()` in the parent class `JAXRSClient0128` is
  relying on `....core.application.TSAppConfig` being present and this
  test includes `....ext.providers.TSAppConfig` instead.
- But the test doesn't fail.
- In the Jakarta REST TCK, they actually broke the hierarchy in the
  latest version and `JAXRSProvidersClient0098` is now depending on
  `JAXRSCommonClient` instead

-> I applied the same change here.

BUT... there are a lot more failures we need to diagnose. Some of them
are quite similar so I suspect there aren't that many issues.
@gsmet
Copy link
Member Author

gsmet commented Mar 19, 2025

I have done some work on the RESTEasy Reactive TCK here: quarkusio/resteasy-reactive-testsuite#13 .

@gsmet
Copy link
Member Author

gsmet commented Mar 24, 2025

This should now be ready but I won't merge it until we merge @holly-cummins 's work.

@gsmet
Copy link
Member Author

gsmet commented Mar 25, 2025

@EsbenNedergaard any chance you could test this branch and check if the combination of JUnit 5.12 and Mockito 5.16 works for you even if not perfectly aligned? I wouldn't want to waste your efforts (even if I would very much want to upgrade JUnit).

gsmet added 5 commits March 25, 2025 16:48
This will make Dependabot upgrade a lot better.
JUnit 5 changed how they handle inheritance to be more in line with what
standard Java does.
This change causes some issues with some of our tests as we can't
leverage overriding for static fields as we did before.

https://junit.org/junit5/docs/5.11.1/release-notes/#release-notes-5.11.0-junit-platform-bug-fixes
On paper, it's compatible with JUnit 5.11.4, let's hope it also works
with 5.12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle area/platform Issues related to definition and interaction with Quarkus Platform area/rest area/resteasy-classic area/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant