@Retention(value=RUNTIME) @Target(value={METHOD,TYPE}) @Repeatable(value=SetSystemProperties.class) @ExtendWith(value=org.junitpioneer.jupiter.SystemPropertyExtension.class) public @interface SetSystemProperty
@SetSystemProperty
is a JUnit Jupiter extension to set the value of a
system property for a test execution.
The key and value of the system property to be set must be specified via
key()
and value()
. After the annotated method has been
executed, the initial default value is restored.
SetSystemProperty
is repeatable and can be used on the method and on
the class level. If a class is annotated, the configured property will be set
for all tests inside that class. Any method level configurations will
override the class level configurations.