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

@DynamicPropertySource in @Nested test class cannot override dynamic properties from enclosing class #31085

Closed
sbrannen opened this issue Aug 21, 2023 · 1 comment
Assignees
Labels
in: test Issues in the test module type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug
Milestone

Comments

@sbrannen
Copy link
Member

@sbrannen sbrannen added in: test Issues in the test module type: bug A general bug labels Aug 21, 2023
@sbrannen sbrannen added this to the 5.3.30 milestone Aug 21, 2023
@sbrannen sbrannen self-assigned this Aug 21, 2023
@sbrannen sbrannen added the type: backport An issue that is a backport of another issue to a maintenance branch label Aug 21, 2023
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Aug 21, 2023
Beginning with Java 16, inner classes may contain static members. We
therefore need to search for @DynamicPropertySource methods in the
current class after searching enclosing classes so that a local
@DynamicPropertySource method can override properties registered in an
enclosing class.

However, since Spring Framework 5.3.x is built using Java 8, this
commit removes DynamicPropertySourceOverridesEnclosingClassTests since
it declares a static method in a @nested (inner) test class, which
results in a compiler error on Java 8.

See https://bugs.openjdk.org/browse/JDK-8254321
See spring-projectsgh-31085
@sbrannen
Copy link
Member Author

Fixed in 9894174 and revised in d7ac89e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant