-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
base: main
Are you sure you want to change the base?
Upgrade to JUnit 5.12.1 #46871
Conversation
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.
I have done some work on the RESTEasy Reactive TCK here: quarkusio/resteasy-reactive-testsuite#13 . |
This should now be ready but I won't merge it until we merge @holly-cummins 's work. |
@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). |
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.
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.