Annotation Interface DisabledIf
@DisabledIf is used to signal that the annotated test class or test
 method is disabled and should not be executed if the supplied
 expression() evaluates to true.
 When applied at the class level, all test methods within that class are automatically disabled as well.
For basic examples, see the Javadoc for expression().
 
This annotation may be used as a meta-annotation to create
 custom composed annotations. For example, a custom
 @DisabledOnMac annotation can be created as follows.
 
 @Target({ElementType.TYPE, ElementType.METHOD})
 @Retention(RetentionPolicy.RUNTIME)
 @DisabledIf(
     expression = "#{systemProperties['os.name'].toLowerCase().contains('mac')}",
     reason = "Disabled on Mac OS"
 )
 public @interface DisabledOnMac {}
 
 Please note that @DisabledOnMac is meant only as an example of what
 is possible. If you have that exact use case, please use the built-in
 @DisabledOnOs(MAC) support
 in JUnit Jupiter.
 
Since JUnit 5.7, JUnit Jupiter also has a condition annotation named
 @DisabledIf. Thus, if you
 wish to use Spring's @DisabledIf support make sure you import the
 annotation type from the correct package.
- Since:
- 5.0
- Author:
- Sam Brannen, Tadaya Tsuyukubo
- See Also:
- 
- SpringExtension
- EnabledIf
- Disabled
- DisabledIf
 
- 
Optional Element SummaryOptional ElementsModifier and TypeOptional ElementDescriptionThe expression that will be evaluated to determine if the annotated test class or test method is disabled.booleanWhether theApplicationContextassociated with the current test should be eagerly loaded in order to evaluate theexpression().The reason this test is disabled.
- 
Element Details- 
value- See Also:
 - Default:
- ""
 
- 
expressionThe expression that will be evaluated to determine if the annotated test class or test method is disabled.If the expression evaluates to Boolean.TRUEor aStringequal to"true"(ignoring case), the test will be disabled.Expressions can be any of the following. - Spring Expression Language (SpEL) expression — for example:
 @DisabledIf("#{systemProperties['os.name'].toLowerCase().contains('mac')}")
- Placeholder for a property available in the Spring
 Environment— for example:@DisabledIf("${smoke.tests.disabled}")
- Text literal — for example:
 @DisabledIf("true")
 Note, however, that a text literal which is not the result of dynamic resolution of a property placeholder is of zero practical value since @DisabledIf("true")is equivalent to@Disabledand@DisabledIf("false")is logically meaningless.- See Also:
 - Default:
- ""
 
- Spring Expression Language (SpEL) expression — for example:
 
- 
reasonString reasonThe reason this test is disabled.- See Also:
 - Default:
- ""
 
- 
loadContextboolean loadContextWhether theApplicationContextassociated with the current test should be eagerly loaded in order to evaluate theexpression().Defaults to falseso that test application contexts are not eagerly loaded unnecessarily. If an expression is based solely on system properties or environment variables or does not interact with beans in the test's application context, there is no need to load the context prematurely since doing so would be a waste of time if the test ends up being disabled.- See Also:
 - Default:
- false
 
 
-