@Documented
@Incubating
@Retention(value=RetentionPolicy.RUNTIME)
@Target(value=[ElementType.TYPE, ElementType.METHOD])
@ExtendWith(value=GroovyConditionExtension.class)
@interface GroovyDisabledIf
Disables the annotated test class or method if the Groovy closure evaluates to true.
The closure is evaluated with a delegate providing the following bindings:
systemEnvironment — System.getenv()systemProperties — System.getProperties()javaVersion — Runtime Java feature version (e.g. 17, 21)junitTags — tags assigned to the testjunitDisplayName — display name of the testjunitUniqueId — unique ID of the testExample usage:
@Test
@GroovyDisabledIf({ systemProperties['os.arch']?.contains('32') })
void not32Bit() { ... }
@Test
@GroovyDisabledIf({ 'slow' in junitTags && systemEnvironment['CI'] == 'true' })
void skipSlowOnCI() { ... }