Package com.tngtech.jgiven.annotation
Annotation Interface CaseAs
Use to define a description provider for scenario cases.
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.
- Since:
- v0.16.0
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Whether or not the arguments should be formatted to string using JGiven formatter.Class<? extends CaseAsProvider>
A custom implementation of theCaseAsProvider
to provide a case description.The description of the test case. -
Field Summary
-
Field Details
-
NO_VALUE
Dummy value to indicate that no value was set- See Also:
-
-
Element Details
-
value
String valueThe description of the test case.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.- Default:
- " - no value - "
-
provider
Class<? extends CaseAsProvider> providerA custom implementation of theCaseAsProvider
to provide a case description.- Default:
- com.tngtech.jgiven.impl.params.DefaultCaseAsProvider.class
-
formatValues
boolean formatValuesWhether or not the arguments should be formatted to string using JGiven formatter. If this is set to true the list of parameter values passed to the CaseDescriptionProvider will be a list of strings, otherwise it will be a list of objects with the original values passed to the method.- Default:
- true
-