Annotation Type ForkerParameter
-
@Retention(RUNTIME) @Target(PARAMETER) public @interface ForkerParameter
This annotation is used similar likeFixtureParameter
, just for forkers. Forkers can designate parameters in their constructor with this annotation. These will then be offered when that forker class is referenced in a forkdef structure.- Author:
- Rene Schneider - initial API and implementation
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.String
name
The name of the parameter.
-
-
-
-
mandatory
boolean mandatory
Whether the parameter must be provided or is optional. By default parameters are optional.Note that there is a significant difference between making a parameter mandatory and allowing or disallowing the null value - just because a parameter is mandatory it may still be null, because by providing a null value explicitly in the test script, the "mandatory" part is satisfied. Please see
nullable()
as well if you also want to ensure a parameter may never be null.- Returns:
- Default:
- false
-
-
-
nullable
boolean nullable
Whether a parameter may be the value "null" at the time the fixture method is invoked. By default, parameters are nullable. If a fixture parameter is marked as non-nullable, a null value will lead to anIllegalArgumentException
at runtime, and directly providing null values within test scripts will lead to errors at compile time.In case of multiple parameter values (= an array is provided to the fixture), setting the parameter to non-nullable will cause an exception if at least one of the provided values is null, regardless of whether other provided values are non-null.
Note that there is a significant difference between allowing or disallowing null as a value vs. making a parameter mandatory! Please see
mandatory()
as well.- Returns:
- Default:
- true
-
-