Annotation Interface ClearSystemProperty


@Retention(RUNTIME) @Target({METHOD,TYPE}) @Inherited @Repeatable(ClearSystemProperty.ClearSystemProperties.class) @ExtendWith(org.junit.jupiter.api.util.SystemPropertiesExtension.class) @API(status=EXPERIMENTAL, since="6.1") public @interface ClearSystemProperty
@ClearSystemProperty is an annotation that is used to clear the value of a JVM system property for test execution.

The key of the system property must be specified via the key attribute.

@ClearSystemProperty can be used on the method and on the class level. It is repeatable and @Inherited from higher-level containers. If a class is annotated, the configured property will be cleared before every test inside that class. After a test has completed, the original value of the system property will be restored.

During parallel test execution, all tests annotated with @SetSystemProperty, @ClearSystemProperty, @ReadsSystemProperty, and @WritesSystemProperty are scheduled in a way that guarantees correctness under mutation of shared global state.

For further details and examples, see the documentation on all JVM system property annotations in the User Guide.

Since:
6.1
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    @ClearSystemProperties is a container for one or more ClearSystemProperty declarations.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The key of the system property to clear.
  • Element Details

    • key

      String key
      The key of the system property to clear.