@Documented
@Inherited
@Retention(value=RUNTIME)
@Target(value={METHOD,TYPE})
public @interface CaseAs
By default, multiple cases in a parametrized scenario are described by just listing the parameter names with their corresponding values. Sometimes, however, it is useful to provide an explicit description the provides more semantic background for each case. This annotation can be used to define custom descriptions. The enumeration of arguments starts from index 1.
Modifier and Type | Fields and Description |
---|---|
static java.lang.String |
NO_VALUE
Dummy value to indicate that no value was set
|
Modifier and Type | Optional Element and Description |
---|---|
boolean |
formatValues
Whether or not the arguments should be formatted to string using JGiven formatter.
|
java.lang.Class<? extends CaseAsProvider> |
provider
A custom implementation of the
CaseAsProvider to provide a case description. |
java.lang.String |
value
The description of the test case.
|
public static final java.lang.String NO_VALUE
public abstract java.lang.String value
Placeholders of the form $i
can be used that will be filled with the values of the ith parameter, starting from 1.
For example, a value "Hi $1"
will be translated to "Hi JGiven"
if "JGiven" is the value of the first parameter of the test method.
public abstract java.lang.Class<? extends CaseAsProvider> provider
CaseAsProvider
to provide a case description.public abstract boolean formatValues