JUnit test annotated with '@Ignore'/'@Disabled'
Reports usages of JUnit 4's @Ignore
or JUnit 5's @Disabled
annotations. It is considered a code smell to have tests annotated with these annotations for a long time, especially when no reason is specified.
Example:
@Ignore
public class UrgentTest {
@Test
public void testIt() {
Assert.assertEquals("expected", "actual");
}
}
Configure the inspection:
Use the Only report annotations without reason option to only report the cases when no reason is specified as the annotation's
value
attribute.
Inspection options
Option | Type | Default |
---|---|---|
Only report annotations without reason | Checkbox | true |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Java, 233.SNAPSHOT |
Last modified: 13 July 2023