Skip to content

Commit

Permalink
Add implementation note
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Aug 21, 2023
1 parent 620a87b commit 9911d91
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -55,6 +55,11 @@ public DynamicPropertiesContextCustomizer createContextCustomizer(Class<?> testC
}

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);
}
Expand Down

0 comments on commit 9911d91

Please sign in to comment.