Merge branch '6.0.x'

This commit is contained in:
Sam Brannen 2023-08-21 15:19:27 +02:00
commit 583d92e69a
1 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,11 @@ class DynamicPropertiesContextCustomizerFactory implements ContextCustomizerFact
}
private void findMethods(Class<?> testClass, Set<Method> methods) {
// 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.
if (TestContextAnnotationUtils.searchEnclosingClass(testClass)) {
findMethods(testClass.getEnclosingClass(), methods);
}