Skip to content

Commit a74a1db

Browse files
committed
Add documentation for JGiven configuration annotation
Signed-off-by: l-1squared <[email protected]>
1 parent 416f9d7 commit a74a1db

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

docs/report_generation.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,6 @@ jgiven.report.text.color
217217
jgiven.report.filterStackTrace=true
218218
----
219219
Configuration defined via Java system properties will take precedence over values in the configuration file.
220+
221+
=== Configuration class
222+
Finally, JGiven allows to set a custom derivative of `AbstractJGivenConfiguration` on the class level via the `@JGivenConfiguration` annotation. Tag configuration, formatter configuration and a default `xref:_overriding_the_default_reporting[@As provider]` provider can be set there.

docs/stages.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ I fill out the registration form
3636
----
3737
The nested steps will appear as a collapsible group in the HTML report.
3838

39+
[#_overriding_the_default_reporting]
3940
=== Overriding the Default Reporting
4041

41-
Sometimes it is necessary to override the default way of the step reporting. For example, if you want to use special characters that are not allowed in Java methods names, such as `(`, `+`, or `%`. You can then use the `@As` annotation to specify what JGiven should put into the report.
42+
Sometimes it is necessary to override the default way of the step reporting. For example, if you want to use special characters that are not allowed in Java methods names, such as `(`, `+`, or `%`, you can then use the `@As` annotation to specify what JGiven should put into the report.
4243

4344
For example, if you define the following step method:
4445

@@ -66,6 +67,7 @@ public MyStage some_step() {
6667
return self();
6768
}
6869
----
70+
In addition, the `@As` annotation allows declaring an `AsProvider` that handles the step name generation. A default provider can be set via `@JGivenConfiguration` annotation in the class referenced there.
6971

7072
=== Completely Hide Steps
7173

jgiven-core/src/main/java/com/tngtech/jgiven/annotation/JGivenConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* <ul>
1313
* <li>Tags</li>
1414
* <li>Global formatter</li>
15+
* <li>Default {@link As} provider</li>
1516
* </ul>
1617
*/
1718
@Retention( RetentionPolicy.RUNTIME )

0 commit comments

Comments
 (0)