Annotation Type IgnoreTest


@Documented
@Retention(RUNTIME)
public @interface IgnoreTest
Annotates a Java object to be ignored in tests. This annotation is useful when you want to unit-test objects and classes for specific structures but these objects/classes define additional elements that would cause the test to fail although they are not relevant for your unit test.

E.g. a unit test was written to test all getters/setters in an object. However, there are setters that are intentionally defined different. This annotation could inform the unit-test that these methods intentionally do not fulfill the getter/setter requirement and hence shall not be considered in that unit test.

The annotation can hold strings that identify certain types within your unit test. This allows to selectively ignore specific types of tests.

Examples:
@IgnoreTest - will ignore all tests.
@IgnoreTest("getter") - will ignore only those tests that care about getters.
@IgnoreTest({"getter", "setter"}) - will ignore only those tests that care about getters and setters.

Please notice that ignoring tests must be implemented in your unit tests. The annotation can be checked through IgnoreChecks.ignoreTest(java.lang.reflect.AnnotatedElement, String...).

Author:
ralph
  • Optional Element Summary

    Optional Elements 
    Modifier and Type Optional Element Description
    java.lang.String[] value
    The type of tests that the annotated object will be ignored for.
  • Element Details

    • value

      java.lang.String[] value
      The type of tests that the annotated object will be ignored for.
      Returns:
      the type of methods to be ignored
      Default:
      {}