File tree Expand file tree Collapse file tree 5 files changed +32
-0
lines changed
framework-docs/modules/ROOT Expand file tree Collapse file tree 5 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 182182**** * xref:testing/annotations/integration-spring/annotation-sqlconfig.adoc[]
183183**** * xref:testing/annotations/integration-spring/annotation-sqlmergemode.adoc[]
184184**** * xref:testing/annotations/integration-spring/annotation-sqlgroup.adoc[]
185+ **** * xref:testing/annotations/integration-spring/annotation-disabledinaotmode.adoc[]
185186**** xref:testing/annotations/integration-junit4.adoc[]
186187**** xref:testing/annotations/integration-junit-jupiter.adoc[]
187188**** xref:testing/annotations/integration-meta.adoc[]
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ xref:testing/testcontext-framework/support-classes.adoc#testcontext-junit-jupite
1111* xref:testing/annotations/integration-junit-jupiter.adoc#integration-testing-annotations-nestedtestconfiguration[`@NestedTestConfiguration`]
1212* xref:testing/annotations/integration-junit-jupiter.adoc#integration-testing-annotations-junit-jupiter-enabledif[`@EnabledIf`]
1313* xref:testing/annotations/integration-junit-jupiter.adoc#integration-testing-annotations-junit-jupiter-disabledif[`@DisabledIf`]
14+ * xref:testing/annotations/integration-spring/annotation-disabledinaotmode.adoc[`@DisabledInAotMode`]
1415
1516[[integration-testing-annotations-junit-jupiter-springjunitconfig]]
1617== `@SpringJUnitConfig`
Original file line number Diff line number Diff line change @@ -27,4 +27,5 @@ Spring's testing annotations include the following:
2727* xref:testing/annotations/integration-spring/annotation-sqlconfig.adoc[`@SqlConfig`]
2828* xref:testing/annotations/integration-spring/annotation-sqlmergemode.adoc[`@SqlMergeMode`]
2929* xref:testing/annotations/integration-spring/annotation-sqlgroup.adoc[`@SqlGroup`]
30+ * xref:testing/annotations/integration-spring/annotation-disabledinaotmode.adoc[`@DisabledInAotMode`]
3031
Original file line number Diff line number Diff line change 1+ [[spring-testing-annotation-disabledinaotmode]]
2+ = `@DisabledInAotMode`
3+
4+ `@DisabledInAotMode` signals that an annotated test class is disabled in Spring AOT
5+ (ahead-of-time) mode, which means that the `ApplicationContext` for the test class will
6+ not be processed for AOT optimizations at build time.
7+
8+ If a test class is annotated with `@DisabledInAotMode`, all other test classes which
9+ specify configuration to load the same `ApplicationContext` must also be annotated with
10+ `@DisabledInAotMode`. Failure to annotate all such test classes will result in an
11+ exception, either at build time or run time.
12+
13+ When used with JUnit Jupiter based tests, `@DisabledInAotMode` also signals that the
14+ annotated test class or test method is disabled when running the test suite in Spring AOT
15+ mode. When applied at the class level, all test methods within that class will be
16+ disabled. In this sense, `@DisabledInAotMode` has semantics similar to those of JUnit
17+ Jupiter's `@DisabledInNativeImage` annotation.
18+
19+ For details on AOT support specific to integration tests, see
20+ xref:testing/testcontext-framework/aot.adoc[Ahead of Time Support for Tests].
Original file line number Diff line number Diff line change @@ -19,6 +19,15 @@ following features.
1919 use an AOT-optimized `ApplicationContext` that participates transparently with the
2020 xref:testing/testcontext-framework/ctx-management/caching.adoc[context cache].
2121
22+ All tests are enabled in AOT mode by default. However, you can selectively disable an
23+ entire test class or individual test method in AOT mode by annotating it with
24+ xref:testing/annotations/integration-spring/annotation-disabledinaotmode.adoc[`@DisabledInAotMode`].
25+ When using JUnit Jupiter, you may selectively enable or disable tests in a GraalVM native
26+ image via Jupiter's `@EnabledInNativeImage` and `@DisabledInNativeImage` annotations.
27+ Note that `@DisabledInAotMode` also disables the annotated test class or test method when
28+ running within a GraalVM native image, analogous to JUnit Jupiter's
29+ `@DisabledInNativeImage` annotation.
30+
2231[TIP]
2332====
2433By default, if an error is encountered during build-time AOT processing, an exception
You can’t perform that action at this time.
0 commit comments