Skip to content

Commit a875db4

Browse files
committed
Document limitations of @CompileWithTargetClassAccess
Specifically, @CompileWithTargetClassAccess cannot be used with @RepeatedTest and @ParameterizedTest methods since the CompileWithTargetClassAccessExtension cannot support @testtemplate invocations.
1 parent 1e8bc1b commit a875db4

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

spring-core-test/src/main/java/org/springframework/aot/test/generator/compile/CompileWithTargetClassAccess.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,21 @@
2525
import org.junit.jupiter.api.extension.ExtendWith;
2626

2727
/**
28-
* Annotation that can be used on tests that need a {@link TestCompiler} with
29-
* non-public access to target classes. Allows the compiler to define classes
30-
* without polluting the test {@link ClassLoader}.
28+
* Annotation that registers a JUnit Jupiter extension for test classes or test
29+
* methods that need a {@link TestCompiler} with non-public access to target
30+
* classes.
31+
*
32+
* <p>The extension allows the compiler to define classes without polluting the
33+
* test {@link ClassLoader}.
34+
*
35+
* <p>NOTE: this annotation cannot be used in conjunction with
36+
* {@link org.junit.jupiter.api.TestTemplate @TestTemplate} methods.
37+
* Consequently, {@link org.junit.jupiter.api.RepeatedTest @RepeatedTest} and
38+
* {@link org.junit.jupiter.params.ParameterizedTest @ParameterizedTest} methods
39+
* are not supported.
3140
*
3241
* @author Phillip Webb
42+
* @author Sam Brannen
3343
* @since 6.0
3444
*/
3545
@Retention(RetentionPolicy.RUNTIME)

0 commit comments

Comments
 (0)