This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Framework 6.2.0! |
@DisabledInAotMode
@DisabledInAotMode
signals that the annotated test class is disabled in Spring AOT
(ahead-of-time) mode, which means that the ApplicationContext
for the test class will
not be processed for AOT optimizations at build time.
If a test class is annotated with @DisabledInAotMode
, all other test classes which
specify configuration to load the same ApplicationContext
must also be annotated with
@DisabledInAotMode
. Failure to annotate all such test classes will result in an
exception, either at build time or run time.
When used with JUnit Jupiter based tests, @DisabledInAotMode
also signals that the
annotated test class or test method is disabled when running the test suite in Spring AOT
mode. When applied at the class level, all test methods within that class will be
disabled. In this sense, @DisabledInAotMode
has semantics similar to those of JUnit
Jupiter’s @DisabledInNativeImage
annotation.
For details on AOT support specific to integration tests, see Ahead of Time Support for Tests.