Package org.junit.jupiter.api
Annotation Type Disabled
-
@Target({TYPE,METHOD}) @Retention(RUNTIME) @Documented @API(status=STABLE, since="5.0") public @interface Disabled
@Disabled
is used to signal that the annotated test class or test method is currently disabled and should not be executed.@Disabled
may optionally be declared with a reason to document why the annotated test class or test method is disabled.When applied at the class level, all test methods within that class are automatically disabled as well.
This annotation is not
@Inherited
. Consequently, if you wish to apply the same semantics to a subclass, this annotation must be redeclared on the subclass.When applied at the method level, the presence of this annotation 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
@BeforeEach
methods,@AfterEach
methods, and corresponding extension APIs.- Since:
- 5.0
- See Also:
value()
,EnabledIfEnvironmentVariable
,DisabledIfEnvironmentVariable
,EnabledIfSystemProperty
,DisabledIfSystemProperty
,EnabledOnJre
,DisabledOnJre
,EnabledForJreRange
,DisabledForJreRange
,EnabledOnOs
,DisabledOnOs
,EnabledInNativeImage
,DisabledInNativeImage
,ExecutionCondition
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.String
value
The reason this annotated test class or test method is disabled.
-