@Retention(RUNTIME) @Target({ANNOTATION_TYPE,PARAMETER}) public @interface ParametersSuppliedBy
Theory method
parameter with @ParametersSuppliedBy causes it to be supplied with
values from the named
ParameterSupplier
when run as a theory by the Theories runner.
In addition, annotations themselves can be annotated with
@ParametersSuppliedBy, and then used similarly. ParameterSuppliedBy
annotations on parameters are detected by searching up this heirarchy such
that these act as syntactic sugar, making:
@ParametersSuppliedBy(Supplier.class)
public @interface SpecialParameter { }
@Theory
public void theoryMethod(@SpecialParameter String param) {
...
}
equivalent to:
@Theory
public void theoryMethod(@ParametersSuppliedBy(Supplier.class) String param) {
...
}
| Modifier and Type | Required Element | Description |
|---|---|---|
Class<? extends ParameterSupplier> |
value |
Class<? extends ParameterSupplier> value
Copyright © 2002–2018 JUnit. All rights reserved.