-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Upgrading to JUnit 5.11
Sam Brannen edited this page Apr 21, 2024
·
4 revisions
This page provides guidance on upgrading to JUnit 5.11.
Field and method search algorithms now adhere to standard Java semantics regarding whether a given field or method is visible or overridden according to the rules of the Java language. See the new Field and Method Search Semantics section of the User Guide for details.
This results in the following change in behavior.
- Fields no longer hide fields from super types.
- This applies to non-static as well as static fields (
@TempDir
,@RegisterExtension
, etc.).
- This applies to non-static as well as static fields (
- Methods no longer hide methods from super types unless a given method literally overrides the other method.
- This applies to non-static as well as static methods (
@BeforeAll
,@BeforeEach
,@Test
, etc.).
- This applies to non-static as well as static methods (
- Extensions may have to revise their search algorithms for fields and methods.
- See case study in https://github.com/junit-team/junit5/issues/3774) for an example.