Skip to content

Commit

Permalink
documented the fact that final methods cannot be used as step methods (
Browse files Browse the repository at this point in the history
…fixes #148)
  • Loading branch information
Jan Schäfer authored and github-actions committed Sep 26, 2024
1 parent 5833243 commit d0b7c4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stages.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A JGiven scenario consists of multiple stages. Typically there is a stage for ea

## Step Methods

A stage class contains multiple _step methods_ that can be called in a scenario and that will appear in the report. Every *non-private*, *non-static* method of a stage class can be used as a step method. There are no further requirements. In particular, no annotations are needed. Step methods should return the `this` reference so that chaining of calls is possible. In addition, a step method should be written in `snake_case` so that JGiven knows the correct casing of each word of the step.
A stage class contains multiple _step methods_ that can be called in a scenario and that will appear in the report. Every *non-private*, *non-final*, *non-static* method of a stage class can be used as a step method. There are no further requirements. In particular, no annotations are needed. Step methods should return the `this` reference so that chaining of calls is possible. In addition, a step method should be written in `snake_case` so that JGiven knows the correct casing of each word of the step.

The following code shows a valid step method of the `WhenCook` stage:
{% highlight java %}
Expand Down

0 comments on commit d0b7c4b

Please sign in to comment.