Annotation Interface EnabledInNativeImage
@EnabledInNativeImageis used to signal that the annotated test class or test method is only enabled when executing within a GraalVM native image.
When applied at the class level, all test methods within that class will be enabled within a native image.
If a test method is disabled via this annotation, that does not prevent
the test class from being instantiated. Rather, it prevents the execution of
the test method and method-level lifecycle callbacks such as
@AfterEach methods, and corresponding extension APIs.
This annotation may be used as a meta-annotation in order to create a custom composed annotation that inherits the semantics of this annotation.
JUnit detects whether tests are executing within a GraalVM native image by
checking for the presence of the
system property (see
for details). The GraalVM compiler sets the property to
compiling a native image; the property is set to
runtime while a native
image is executing; and the Gradle and Maven plug-ins in the GraalVM
Native Build Tools
project set the property to
agent while executing tests with the GraalVM