From a875db4692d72b2666af57b098573a86e86a2594 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 6 Aug 2022 14:57:35 +0300 Subject: [PATCH] Document limitations of @CompileWithTargetClassAccess Specifically, @CompileWithTargetClassAccess cannot be used with @RepeatedTest and @ParameterizedTest methods since the CompileWithTargetClassAccessExtension cannot support @TestTemplate invocations. --- .../compile/CompileWithTargetClassAccess.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/spring-core-test/src/main/java/org/springframework/aot/test/generator/compile/CompileWithTargetClassAccess.java b/spring-core-test/src/main/java/org/springframework/aot/test/generator/compile/CompileWithTargetClassAccess.java index d4141ae4fe..908298915f 100644 --- a/spring-core-test/src/main/java/org/springframework/aot/test/generator/compile/CompileWithTargetClassAccess.java +++ b/spring-core-test/src/main/java/org/springframework/aot/test/generator/compile/CompileWithTargetClassAccess.java @@ -25,11 +25,21 @@ import java.lang.annotation.Target; import org.junit.jupiter.api.extension.ExtendWith; /** - * Annotation that can be used on tests that need a {@link TestCompiler} with - * non-public access to target classes. Allows the compiler to define classes - * without polluting the test {@link ClassLoader}. + * Annotation that registers a JUnit Jupiter extension for test classes or test + * methods that need a {@link TestCompiler} with non-public access to target + * classes. + * + *

The extension allows the compiler to define classes without polluting the + * test {@link ClassLoader}. + * + *

NOTE: this annotation cannot be used in conjunction with + * {@link org.junit.jupiter.api.TestTemplate @TestTemplate} methods. + * Consequently, {@link org.junit.jupiter.api.RepeatedTest @RepeatedTest} and + * {@link org.junit.jupiter.params.ParameterizedTest @ParameterizedTest} methods + * are not supported. * * @author Phillip Webb + * @author Sam Brannen * @since 6.0 */ @Retention(RetentionPolicy.RUNTIME)